⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wavefront.h

📁 linux 内核源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
#ifndef __SOUND_WAVEFRONT_H__#define __SOUND_WAVEFRONT_H__/* *  Driver for Turtle Beach Wavefront cards (Maui,Tropez,Tropez+) * *  Copyright (c) by Paul Barton-Davis <pbd@op.net> * *   This program is free software; you can redistribute it and/or modify *   it under the terms of the GNU General Public License as published by *   the Free Software Foundation; either version 2 of the License, or *   (at your option) any later version. * *   This program is distributed in the hope that it will be useful, *   but WITHOUT ANY WARRANTY; without even the implied warranty of *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *   GNU General Public License for more details. * *   You should have received a copy of the GNU General Public License *   along with this program; if not, write to the Free Software *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA */#if (!defined(__GNUC__) && !defined(__GNUG__))     You will not be able to compile this file correctly without gcc, because     it is necessary to pack the "wavefront_alias" structure to a size     of 22 bytes, corresponding to 16-bit alignment (as would have been     the case on the original platform, MS-DOS). If this is not done,     then WavePatch-format files cannot be read/written correctly.     The method used to do this here ("__attribute__((packed)") is     completely compiler dependent.          All other wavefront_* types end up aligned to 32 bit values and     still have the same (correct) size.#else     /* However, note that as of G++ 2.7.3.2, g++ was unable to	correctly parse *type* __attribute__ tags. It will do the	right thing if we use the "packed" attribute on each struct	member, which has the same semantics anyway.      */#endif /* __GNUC__ *//***************************** WARNING ********************************  PLEASE DO NOT MODIFY THIS FILE IN ANY WAY THAT AFFECTS ITS ABILITY TO   BE USED WITH EITHER C *OR* C++. **********************************************************************/#ifndef NUM_MIDIKEYS #define NUM_MIDIKEYS 128#endif  /* NUM_MIDIKEYS */#ifndef NUM_MIDICHANNELS#define NUM_MIDICHANNELS 16#endif  /* NUM_MIDICHANNELS *//* These are very useful/important. the original wavefront interface   was developed on a 16 bit system, where sizeof(int) = 2   bytes. Defining things like this makes the code much more portable, and   easier to understand without having to toggle back and forth   between a 16-bit view of the world and a 32-bit one.  */   #ifndef __KERNEL__/* keep them for compatibility */typedef short s16;typedef unsigned short u16;typedef int s32;typedef unsigned int u32;typedef char s8;typedef unsigned char u8;typedef s16 INT16;typedef u16 UINT16;typedef s32 INT32;typedef u32 UINT32;typedef s8 CHAR8;typedef u8 UCHAR8;#endif/* Pseudo-commands not part of the WaveFront command set.   These are used for various driver controls and direct   hardware control. */#define WFC_DEBUG_DRIVER                0#define WFC_FX_IOCTL                    1#define WFC_PATCH_STATUS                2#define WFC_PROGRAM_STATUS              3#define WFC_SAMPLE_STATUS               4#define WFC_DISABLE_INTERRUPTS          5#define WFC_ENABLE_INTERRUPTS           6#define WFC_INTERRUPT_STATUS            7#define WFC_ROMSAMPLES_RDONLY           8#define WFC_IDENTIFY_SLOT_TYPE          9/* Wavefront synth commands */#define WFC_DOWNLOAD_SAMPLE		0x80#define WFC_DOWNLOAD_BLOCK		0x81#define WFC_DOWNLOAD_MULTISAMPLE	0x82#define WFC_DOWNLOAD_SAMPLE_ALIAS	0x83#define WFC_DELETE_SAMPLE		0x84#define WFC_REPORT_FREE_MEMORY		0x85#define WFC_DOWNLOAD_PATCH		0x86#define WFC_DOWNLOAD_PROGRAM		0x87#define WFC_SET_SYNTHVOL		0x89#define WFC_SET_NVOICES			0x8B#define WFC_DOWNLOAD_DRUM		0x90#define WFC_GET_SYNTHVOL		0x92#define WFC_GET_NVOICES			0x94#define WFC_DISABLE_CHANNEL		0x9A#define WFC_ENABLE_CHANNEL		0x9B#define WFC_MISYNTH_OFF			0x9D#define WFC_MISYNTH_ON			0x9E#define WFC_FIRMWARE_VERSION		0x9F#define WFC_GET_NSAMPLES		0xA0#define WFC_DISABLE_DRUM_PROGRAM	0xA2#define WFC_UPLOAD_PATCH		0xA3#define WFC_UPLOAD_PROGRAM		0xA4#define WFC_SET_TUNING			0xA6#define WFC_GET_TUNING			0xA7#define WFC_VMIDI_ON			0xA8#define WFC_VMIDI_OFF			0xA9#define WFC_MIDI_STATUS			0xAA#define WFC_GET_CHANNEL_STATUS		0xAB#define WFC_DOWNLOAD_SAMPLE_HEADER	0xAC#define WFC_UPLOAD_SAMPLE_HEADER	0xAD#define WFC_UPLOAD_MULTISAMPLE		0xAE#define WFC_UPLOAD_SAMPLE_ALIAS		0xAF#define WFC_IDENTIFY_SAMPLE_TYPE	0xB0#define WFC_DOWNLOAD_EDRUM_PROGRAM	0xB1#define WFC_UPLOAD_EDRUM_PROGRAM	0xB2#define WFC_SET_EDRUM_CHANNEL		0xB3#define WFC_INSTOUT_LEVELS		0xB4#define WFC_PEAKOUT_LEVELS		0xB5#define WFC_REPORT_CHANNEL_PROGRAMS	0xB6#define WFC_HARDWARE_VERSION		0xCF#define WFC_UPLOAD_SAMPLE_PARAMS	0xD7#define WFC_DOWNLOAD_OS			0xF1#define WFC_NOOP                        0xFF#define WF_MAX_SAMPLE   512#define WF_MAX_PATCH    256#define WF_MAX_PROGRAM  128#define WF_SECTION_MAX  44   /* longest OS section length *//* # of bytes we send to the board when sending it various kinds of   substantive data, such as samples, patches and programs.*/#define WF_PROGRAM_BYTES 32#define WF_PATCH_BYTES 132#define WF_SAMPLE_BYTES 27#define WF_SAMPLE_HDR_BYTES 25#define WF_ALIAS_BYTES 25#define WF_DRUM_BYTES 9#define WF_MSAMPLE_BYTES 259 /* (MIDI_KEYS * 2) + 3 */#define WF_ACK     0x80#define WF_DMA_ACK 0x81/* OR-values for MIDI status bits */#define WF_MIDI_VIRTUAL_ENABLED 0x1#define WF_MIDI_VIRTUAL_IS_EXTERNAL 0x2#define WF_MIDI_IN_TO_SYNTH_DISABLED 0x4/* slot indexes for struct address_info: makes code a little more mnemonic */#define WF_SYNTH_SLOT         0#define WF_INTERNAL_MIDI_SLOT 1#define WF_EXTERNAL_MIDI_SLOT 2/* Magic MIDI bytes used to switch I/O streams on the ICS2115 MPU401   emulation. Note these NEVER show up in output from the device and   should NEVER be used in input unless Virtual MIDI mode has been    disabled. If they do show up as input, the results are unpredictable.*/#define WF_EXTERNAL_SWITCH  0xFD#define WF_INTERNAL_SWITCH  0xF9/* Debugging flags */#define WF_DEBUG_CMD 0x1#define WF_DEBUG_DATA 0x2#define WF_DEBUG_LOAD_PATCH 0x4#define WF_DEBUG_IO 0x8/* WavePatch file format stuff */#define WF_WAVEPATCH_VERSION     120;  /*  Current version number (1.2)  */#define WF_MAX_COMMENT           64    /*  Comment length */#define WF_NUM_LAYERS            4#define WF_NAME_LENGTH           32#define WF_SOURCE_LENGTH         260#define BankFileID     "Bank"#define DrumkitFileID  "DrumKit"#define ProgramFileID  "Program"struct wf_envelope{    u8 attack_time:7;    u8 Unused1:1;    u8 decay1_time:7;    u8 Unused2:1;    u8 decay2_time:7;    u8 Unused3:1;    u8 sustain_time:7;    u8 Unused4:1;    u8 release_time:7;    u8 Unused5:1;    u8 release2_time:7;    u8 Unused6:1;    s8 attack_level;    s8 decay1_level;    s8 decay2_level;    s8 sustain_level;    s8 release_level;    u8 attack_velocity:7;    u8 Unused7:1;    u8 volume_velocity:7;    u8 Unused8:1;    u8 keyboard_scaling:7;    u8 Unused9:1;};typedef struct wf_envelope wavefront_envelope;struct wf_lfo{    u8 sample_number;    u8 frequency:7;    u8 Unused1:1;    u8 am_src:4;    u8 fm_src:4;    s8 fm_amount;    s8 am_amount;    s8 start_level;    s8 end_level;    u8 ramp_delay:7;    u8 wave_restart:1; /* for LFO2 only */    u8 ramp_time:7;    u8 Unused2:1;};typedef struct wf_lfo wavefront_lfo;struct wf_patch{    s16  frequency_bias;         /*  ** THIS IS IN MOTOROLA FORMAT!! ** */    u8 amplitude_bias:7;    u8 Unused1:1;    u8 portamento:7;    u8 Unused2:1;    u8 sample_number;    u8 pitch_bend:4;    u8 sample_msb:1;    u8 Unused3:3;    u8 mono:1;    u8 retrigger:1;    u8 nohold:1;    u8 restart:1;    u8 filterconfig:2; /* SDK says "not used" */    u8 reuse:1;    u8 reset_lfo:1;        u8 fm_src2:4;    u8 fm_src1:4;       s8 fm_amount1;    s8 fm_amount2;    u8 am_src:4;    u8 Unused4:4;    s8 am_amount;    u8 fc1_mode:4;    u8 fc2_mode:4;    s8 fc1_mod_amount;    s8 fc1_keyboard_scaling;    s8 fc1_bias;    s8 fc2_mod_amount;    s8 fc2_keyboard_scaling;    s8 fc2_bias;    u8 randomizer:7;    u8 Unused5:1;    struct wf_envelope envelope1;    struct wf_envelope envelope2;    struct wf_lfo lfo1;    struct wf_lfo lfo2;};typedef struct wf_patch wavefront_patch;struct wf_layer{    u8 patch_number;    u8 mix_level:7;    u8 mute:1;    u8 split_point:7;    u8 play_below:1;    u8 pan_mod_src:2;    u8 pan_or_mod:1;    u8 pan:4;    u8 split_type:1;};typedef struct wf_layer wavefront_layer;struct wf_program{    struct wf_layer layer[WF_NUM_LAYERS];};typedef struct wf_program wavefront_program;struct wf_sample_offset{    s32 Fraction:4;    s32 Integer:20;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -