tchord.h

来自「在linux下多媒体开发实例linux下多媒体开发」· C头文件 代码 · 共 55 行

H
55
字号
// tchord.h// definitions for guitar chord database and sound functions#ifndef TCHORD_H#define TCHORD_H// maximum number of chords, increase if neededconst int maxChords = 100;// it's a 6 string guitarconst int numStrings = 6;// show this many fretsconst int numFrets = 8;typedef char strings_t[numStrings];// data structure for one guitar chordtypedef struct tutChord{  char longName[40];   // long name (e.g. "C Major"), must be unique  char shortName[8];   // short name (e.g. "C")                       // each string is either 0 (open), X (dead),                       // or a fret number (first fret is 1)  strings_t strings;   // finger for each string (ordered EADGBE)  char sampleFile[80]; // sound sample filename};// type to hold array of chord namestypedef char *chordList_t[maxChords];// class for a database of chordsclass tutChords{public:  tutChords() { fileName[0] = 0; numChords = 0; }  tutChords(char *filename); ~tutChords() { fileName[0] = 0; numChords = 0; }  void chordNames(chordList_t list);  // these return -1 on error  int load(char *fileName); // load chord file  int save(char *fileName); // save chord file  int play(char *longName); // play a chord  int fingering(char *longName, strings_t &strings);private:  char fileName[80];         // database file name  tutChord chord[maxChords]; // array of chords  chordList_t chordList;     // list of long chord names  int numChords;             // current number of chords};#endif

⌨️ 快捷键说明

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