source: mainline/uspace/lib/trackmod/types/protracker.h

Last change on this file was 43dd72b7, checked in by Jiri Svoboda <jiri@…>, 11 years ago

Trackmod update: XM file format, new effects, etc.

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*
2 * Copyright (c) 2014 Jiri Svoboda
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup trackmod
30 * @{
31 */
32/**
33 * @file Protracker module (.mod) types.
34 */
35
36#ifndef TYPES_PROTRACKER_H
37#define TYPES_PROTRACKER_H
38
39#include <stdint.h>
40
41enum {
42 /** Module name size */
43 protracker_mod_name_size = 20,
44 /** Sample name size */
45 protracker_smp_name_size = 22,
46 /** Order list max length */
47 protracker_olist_len = 128,
48 /** Number of rows in a pattern */
49 protracker_pattern_rows = 64,
50 /** Default TPR */
51 protracker_def_tpr = 6,
52 /** Default BPM */
53 protracker_def_bpm = 125
54};
55
56/** Protracker initial header. */
57typedef struct {
58 /** Module name */
59 uint8_t name[protracker_mod_name_size];
60} protracker_hdr_t;
61
62/** Protracker sample header. */
63typedef struct {
64 /** Sample name, padded with zeros */
65 uint8_t name[protracker_smp_name_size];
66 /** Sample length in words */
67 uint16_t length;
68 /** Finetune value */
69 uint8_t finetune;
70 /** Default volume */
71 uint8_t def_vol;
72 /** Loop start in words */
73 uint16_t loop_start;
74 /** Loop length in words */
75 uint16_t loop_len;
76} protracker_smp_t;
77
78/** Protracker order list. */
79typedef struct {
80 /** Number of used entries */
81 uint8_t order_list_len;
82 uint8_t mark;
83 /** Order list */
84 uint8_t order_list[protracker_olist_len];
85} protracker_order_list_t;
86
87/** Protracker 15-sample variant headers. */
88typedef struct {
89 /** Initial header */
90 protracker_hdr_t hdr;
91 /** Sample headers. */
92 protracker_smp_t sample[15];
93 /** Order list. */
94 protracker_order_list_t order_list;
95} protracker_15smp_t;
96
97/** Protracker 31-sample variant headers. */
98typedef struct {
99 /** Initial header */
100 protracker_hdr_t hdr;
101 /** Sample headers. */
102 protracker_smp_t sample[31];
103 /** Order list. */
104 protracker_order_list_t order_list;
105 /** Sample tag. */
106 uint8_t sample_tag[4];
107} protracker_31smp_t;
108
109#endif
110
111/** @}
112 */
Note: See TracBrowser for help on using the repository browser.