| 1 | /* | 
|---|
| 2 | * This program is free software; you can redistribute it and/or modify | 
|---|
| 3 | * it under the terms of the GNU General Public License as published by | 
|---|
| 4 | * the Free Software Foundation; either version 2, or (at your option) | 
|---|
| 5 | * any later version. | 
|---|
| 6 | * | 
|---|
| 7 | * This program is distributed in the hope that it will be useful, | 
|---|
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 10 | * GNU General Public License for more details. | 
|---|
| 11 | * | 
|---|
| 12 | * You should have received a copy of the GNU General Public License | 
|---|
| 13 | * along with this program; see the file COPYING.  If not, write to | 
|---|
| 14 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 
|---|
| 15 | */ | 
|---|
| 16 | /* | 
|---|
| 17 | * If you need another license for your project/product (commercial, | 
|---|
| 18 | * noncommercial, whatever) contact me at | 
|---|
| 19 | * | 
|---|
| 20 | * http://www.os2world.com/cdwriting | 
|---|
| 21 | * http://www.geocities.com/SiliconValley/Sector/5785/ | 
|---|
| 22 | * | 
|---|
| 23 | */ | 
|---|
| 24 |  | 
|---|
| 25 | #ifndef _CWAUDIOINC_H_INCLUDED | 
|---|
| 26 | #define _CWAUDIOINC_H_INCLUDED | 
|---|
| 27 |  | 
|---|
| 28 | #include "common.h" | 
|---|
| 29 |  | 
|---|
| 30 | /* Target folder for MM class templates */ | 
|---|
| 31 | #define MMTEMPLATE_FOLDER_ID      "<MMPM2_MMTEMPLATEFOLDER>" | 
|---|
| 32 |  | 
|---|
| 33 | /* Default class titles if name can't be loaded from res dll */ | 
|---|
| 34 | #define CLSTITLE_DIGITALAUDIO    "Digital Audio" | 
|---|
| 35 | #define CLSTITLE_MP3             "MP3Audio.MP3" | 
|---|
| 36 | #define CLSTITLE_WAV             "WAVAudio.WAV" | 
|---|
| 37 | #define CLSTITLE_OGG             "OGGAudio.OGG" | 
|---|
| 38 | #define CLSTITLE_AIF             "AIFAudio.AIF" | 
|---|
| 39 | #define CLSTITLE_AU              "AUAudio.AU" | 
|---|
| 40 | #define CLSTITLE_IFF             "IFFAudio.IFF" | 
|---|
| 41 | #define CLSTITLE_MIDI            "MIDI.MID" | 
|---|
| 42 | #define CLSTITLE_SNDF            "SNDAudio.SND" | 
|---|
| 43 | #define CLSTITLE_VOC             "VOCAudio.VOC" | 
|---|
| 44 | #define CLSTITLE__AU             "_AUAudio._AU" | 
|---|
| 45 | #define CLSTITLE_AUDIOSTREAM     "Audio-Stream" | 
|---|
| 46 | #define CLSTITLE_CDTRACK         "CD-Track" | 
|---|
| 47 | #define CLSTITLE_M3U             "M3U-Playlist" | 
|---|
| 48 | #define CLSTITLE_FLAC            "FLACAudio.FLA" | 
|---|
| 49 |  | 
|---|
| 50 | /* TYPES returned by the classes */ | 
|---|
| 51 | #define TYPE_DIGITALAUDIO    "Digital Audio" | 
|---|
| 52 | #define TYPE_MP3             "MP3" | 
|---|
| 53 | #define TYPE_OGG             "OGGS" | 
|---|
| 54 | #define TYPE_WAV             "WAV" | 
|---|
| 55 | #define TYPE_AIF             "AIF" | 
|---|
| 56 | #define TYPE_AU              "AU" | 
|---|
| 57 | #define TYPE_IFF             "IFF" | 
|---|
| 58 | #define TYPE_MIDI            "MIDI" | 
|---|
| 59 | #define TYPE_SNDF            "SND" | 
|---|
| 60 | #define TYPE_VOC             "VOC" | 
|---|
| 61 | #define TYPE__AU             "_AU" | 
|---|
| 62 | #define TYPE_AUDIOSTREAM     "Audio-Stream" | 
|---|
| 63 | #define TYPE_CDTRACK         "CD-Track" | 
|---|
| 64 | #define TYPE_M3U             "M3U" | 
|---|
| 65 | #define TYPE_FLAC            "FLAC" | 
|---|
| 66 |  | 
|---|
| 67 | /* Setup strings for MMAudio (was CWAudio). These strings will | 
|---|
| 68 | be removed in the future. Use the MM* instead */ | 
|---|
| 69 | #define SETUP_AUDIOTRACKNAME    "CWAUDIOTRACKNAME" | 
|---|
| 70 | #define SETUP_AUDIOARTIST       "CWAUDIOARTIST" | 
|---|
| 71 | #define SETUP_AUDIOALBUM        "CWAUDIOALBUM" | 
|---|
| 72 | #define SETUP_AUDIOCOMMENT      "CWAUDIOCOMMENT" | 
|---|
| 73 | #define SETUP_AUDIOYEAR         "CWAUDIOYEAR" | 
|---|
| 74 | #define SETUP_AUDIOGENRE        "CWAUDIOGENRE" | 
|---|
| 75 | #define SETUP_AUDIOPLAYTIME     "CWAUDIOPLAYTIME" | 
|---|
| 76 | #define SETUP_REFRESH           "CWAUDIOREFRESH" | 
|---|
| 77 | #define SETUP_COPYTAGTO         "CWAUDIOCOPYTAGTO" | 
|---|
| 78 |  | 
|---|
| 79 | #define SETUP_MMAUDIOTRACKNAME    "MMAUDIOTRACKNAME" | 
|---|
| 80 | #define SETUP_MMAUDIOARTIST       "MMAUDIOARTIST" | 
|---|
| 81 | #define SETUP_MMAUDIOALBUM        "MMAUDIOALBUM" | 
|---|
| 82 | #define SETUP_MMAUDIOCOMMENT      "MMAUDIOCOMMENT" | 
|---|
| 83 | #define SETUP_MMAUDIOYEAR         "MMAUDIOYEAR" | 
|---|
| 84 | #define SETUP_MMAUDIOGENRE        "MMAUDIOGENRE" | 
|---|
| 85 | #define SETUP_MMAUDIOPLAYTIME     "MMAUDIOPLAYTIME" | 
|---|
| 86 | #define SETUP_MMREFRESH           "MMREFRESH" | 
|---|
| 87 | #define SETUP_MMCOPYTAGTO         "MMAUDIOCOPYTAGTO" | 
|---|
| 88 | /* For setting volume during playing */ | 
|---|
| 89 | #define SETUP_MMAUDIOVOLUME         "MMAUDIOVOLUME" | 
|---|
| 90 | /* Lighttable */ | 
|---|
| 91 | #define SETUP_MMTHUMBSIZE         "MMTHUMBSIZE" | 
|---|
| 92 |  | 
|---|
| 93 | /* Restore keys for audio info from instance data */ | 
|---|
| 94 | #define  KEY_TIME         4001 | 
|---|
| 95 | #define  KEY_CHANNELS     4002 | 
|---|
| 96 | #define  KEY_SAMPLERATE   4003 | 
|---|
| 97 | #define  KEY_BPS          4004 | 
|---|
| 98 | #define  KEY_FILESIZE     4005 /* also used for image files */ | 
|---|
| 99 | /* #define  KEY_TRACKNAME    4006 | 
|---|
| 100 | #define  KEY_ARTIST       4007 | 
|---|
| 101 | #define  KEY_ALBUM        4008 | 
|---|
| 102 | #define  KEY_COMMENT      4009 | 
|---|
| 103 | #define  KEY_YEAR         4010 | 
|---|
| 104 | #define  KEY_GENRE        4011 */ | 
|---|
| 105 | #define  KEY_TIME_MS      4012 | 
|---|
| 106 | #define  KEY_NUM_AUDIO_BYTES  4013 | 
|---|
| 107 |  | 
|---|
| 108 | #define TRACKNAME_SETTINGS_PANEL 12 | 
|---|
| 109 |  | 
|---|
| 110 | /* Restore keys for image info from instance data */ | 
|---|
| 111 | #define  KEY_WIDTH         4001 | 
|---|
| 112 | #define  KEY_HEIGHT        4002 | 
|---|
| 113 | #define  KEY_DEPTH         4003 | 
|---|
| 114 |  | 
|---|
| 115 |  | 
|---|
| 116 | /* The max length of any new column title */ | 
|---|
| 117 | #define SIZE_TITLE       30 | 
|---|
| 118 | #define NUM_AUDIO_FIELDS 11 /* Num of additional details columns */ | 
|---|
| 119 |  | 
|---|
| 120 | typedef struct _AUDIODETAILS | 
|---|
| 121 | { | 
|---|
| 122 | PSZ pszPlayTime; | 
|---|
| 123 | PSZ pszBitRate;     /* New with 0.2.7 */ | 
|---|
| 124 | PSZ pszSampleRate; | 
|---|
| 125 | PSZ pszChannels; | 
|---|
| 126 | PSZ pszBPS; | 
|---|
| 127 | PSZ pszName; | 
|---|
| 128 | PSZ pszArtist; | 
|---|
| 129 | PSZ pszAlbum; | 
|---|
| 130 | PSZ pszYear; | 
|---|
| 131 | PSZ pszComment; | 
|---|
| 132 | PSZ pszGenre; | 
|---|
| 133 | }AUDIODETAILS; | 
|---|
| 134 | typedef AUDIODETAILS *PAUDIODETAILS; | 
|---|
| 135 |  | 
|---|
| 136 | #define CWAUDIO_VIEW_PLAY ID_MENU_START | 
|---|
| 137 |  | 
|---|
| 138 | /* Parameters for WM_APPTERMINATENOTIFY for controlling playing */ | 
|---|
| 139 | #define ACKEY_START  1 | 
|---|
| 140 | #define ACKEY_STOP   2 | 
|---|
| 141 | #define ACKEY_PAUSE  3 | 
|---|
| 142 | #define ACKEY_RESUME 4 | 
|---|
| 143 | #define ACKEY_NEXT   5 | 
|---|
| 144 | #define ACKEY_VOLUME 6 | 
|---|
| 145 |  | 
|---|
| 146 | /* returned by cwmmQueryTrackStatus()*/ | 
|---|
| 147 | #define TRACK_STATUS_STOPPED 0 | 
|---|
| 148 | #define TRACK_STATUS_PLAYING 1 | 
|---|
| 149 | #define TRACK_STATUS_PAUSED  2 | 
|---|
| 150 |  | 
|---|
| 151 |  | 
|---|
| 152 |  | 
|---|
| 153 | /* MMImage */ | 
|---|
| 154 | #define NUM_IMAGE_DETAILS_FIELDS 4 /* Num of additional details columns */ | 
|---|
| 155 |  | 
|---|
| 156 | char chrWidth[SIZE_TITLE]; | 
|---|
| 157 | char chrHeight[SIZE_TITLE]; | 
|---|
| 158 | char chrDepth[SIZE_TITLE]; | 
|---|
| 159 | char chrFormat[SIZE_TITLE]; | 
|---|
| 160 |  | 
|---|
| 161 | typedef struct _IMAGEDETAILS | 
|---|
| 162 | { | 
|---|
| 163 | ULONG ulWidth; | 
|---|
| 164 | ULONG ulHeight; | 
|---|
| 165 | ULONG ulDepth; | 
|---|
| 166 | PSZ pszFormat; | 
|---|
| 167 | }IMAGEDETAILS; | 
|---|
| 168 | typedef IMAGEDETAILS *PIMAGEDETAILS; | 
|---|
| 169 |  | 
|---|
| 170 |  | 
|---|
| 171 | /* The maximum size of returned small bitmaps for lighttable folder. Used if someone tries to get | 
|---|
| 172 | a wider BMP. */ | 
|---|
| 173 | #define MAX_SIZE_SMALLBITMAP 250 | 
|---|
| 174 |  | 
|---|
| 175 | /* Thread parameters used when requesting a new small bitmap from the create bitmap thread. */ | 
|---|
| 176 | typedef struct _CREATEBMPINFO | 
|---|
| 177 | { | 
|---|
| 178 | WPObject * wpObject; | 
|---|
| 179 | PMINIRECORDCORE pmrcToRefresh; /* Object record in container. Will be refreshed to show image instead of icon. */ | 
|---|
| 180 | HWND hwndCnr;                  /* Container containing the object. Will be refreshed to show image instead of icon. */ | 
|---|
| 181 | ULONG ulWidth; | 
|---|
| 182 | ULONG ulHeight; | 
|---|
| 183 | }CREATEBMPINFO; | 
|---|
| 184 | typedef CREATEBMPINFO *PCREATEBMPINFO; | 
|---|
| 185 |  | 
|---|
| 186 | /* Tell create bitmap thread to create a new small bitmap */ | 
|---|
| 187 | #define ACKEY_CREATE_SMALLBITMAP  0 | 
|---|
| 188 | /* Tell create bitmap thread to read in the image info so cached image size will be | 
|---|
| 189 | updated. */ | 
|---|
| 190 | #define ACKEY_QUERY_BITMAPINFO    1 | 
|---|
| 191 |  | 
|---|
| 192 | /* | 
|---|
| 193 | Parameter block given to the play thread when audio objects are started using method | 
|---|
| 194 | cwmmPlayTrack(). | 
|---|
| 195 | */ | 
|---|
| 196 | typedef struct _OPENPARAMS | 
|---|
| 197 | { | 
|---|
| 198 | WPObject* wpObject; /* Object being started. */ | 
|---|
| 199 | HWND hwndCnr;      /* Container from which the object is started. */ | 
|---|
| 200 | ULONG ulReserved1; | 
|---|
| 201 | ULONG ulReserved2; | 
|---|
| 202 | ULONG ulReserved3; | 
|---|
| 203 | //PID pid; | 
|---|
| 204 | //  SWCNTRL swCtrl; | 
|---|
| 205 | USEITEM useItem;   /* Tell the WPS the object is in use when playing so inuse emphasis | 
|---|
| 206 | is drawn. An OPEN_VIEW item is added to the inuse list. The information | 
|---|
| 207 | is in the following VIEWITEM. These two structures are used together! */ | 
|---|
| 208 | VIEWITEM viewItem; /* Used to register the open view with the WPS. */ | 
|---|
| 209 | }OPENPARAMS; | 
|---|
| 210 |  | 
|---|
| 211 | typedef struct _MMDATAFILEVIEW | 
|---|
| 212 | { | 
|---|
| 213 | USEITEM useItem; | 
|---|
| 214 | VIEWITEM viewItem; | 
|---|
| 215 | WPObject* thisPtr; | 
|---|
| 216 | PID pid; | 
|---|
| 217 | SWCNTRL swCtrl; | 
|---|
| 218 | WPObject* wpObject; | 
|---|
| 219 | }MMDATAFILEVIEW; | 
|---|
| 220 |  | 
|---|
| 221 |  | 
|---|
| 222 | #define DEFAULT_AUDIOSTREAM_SERVER "Icecast-Server:port" | 
|---|
| 223 |  | 
|---|
| 224 | /* Ini key for enabling new image class features on CD */ | 
|---|
| 225 | #define IMAGECLS_FEATURES_ON_CD_KEY    "useNewImgClsFeaturesOnCD" | 
|---|
| 226 | /* Ini key to disable extended icon titles for audio files */ | 
|---|
| 227 | #define MM_NO_EXTENDED_ICONTITLE    "mmClsNoExtendedIconTitles" | 
|---|
| 228 |  | 
|---|
| 229 | /* Help panels */ | 
|---|
| 230 | #define M3UFILE_HELP_PANEL  40 | 
|---|
| 231 |  | 
|---|
| 232 | /* Maximum # of startable audio files at the same time. This | 
|---|
| 233 | prevents that a user starts a whole folder full of audio objects. | 
|---|
| 234 | see CWAudio */ | 
|---|
| 235 | #define MAX_AUDIOFILE_STARTS 1 | 
|---|
| 236 |  | 
|---|
| 237 | /* Default volume for audio file if no entry in INI file. Used only for double click | 
|---|
| 238 | starting. */ | 
|---|
| 239 | #define DEFVOLUME_AUDIO_FILE  70 | 
|---|
| 240 | #define CLASS_VOLUME_APP   "classvolume" | 
|---|
| 241 | #define CLASS_VOLUME_KEY   "volume" | 
|---|
| 242 |  | 
|---|
| 243 | #endif | 
|---|
| 244 |  | 
|---|
| 245 |  | 
|---|
| 246 |  | 
|---|
| 247 |  | 
|---|
| 248 |  | 
|---|
| 249 |  | 
|---|
| 250 |  | 
|---|
| 251 |  | 
|---|
| 252 |  | 
|---|
| 253 |  | 
|---|