diff --git a/reactos/base/applications/mplay32/lang/bg-BG.rc b/reactos/base/applications/mplay32/lang/bg-BG.rc index fa68fc91725..566e2476848 100644 --- a/reactos/base/applications/mplay32/lang/bg-BG.rc +++ b/reactos/base/applications/mplay32/lang/bg-BG.rc @@ -26,6 +26,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/cs-CZ.rc b/reactos/base/applications/mplay32/lang/cs-CZ.rc index 3a5e5f3b39a..a31d1851cb0 100644 --- a/reactos/base/applications/mplay32/lang/cs-CZ.rc +++ b/reactos/base/applications/mplay32/lang/cs-CZ.rc @@ -27,6 +27,7 @@ BEGIN END POPUP "&Zařízení" BEGIN + MENUITEM SEPARATOR MENUITEM "&Vlastnosti", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "Ovládání &hlasitosti", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/de-DE.rc b/reactos/base/applications/mplay32/lang/de-DE.rc index b3d6afc7579..62fbeb06215 100644 --- a/reactos/base/applications/mplay32/lang/de-DE.rc +++ b/reactos/base/applications/mplay32/lang/de-DE.rc @@ -22,6 +22,7 @@ BEGIN END POPUP "&Gerät" BEGIN + MENUITEM SEPARATOR MENUITEM "&Eigenschaften", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Lautstärkeregelung", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/en-US.rc b/reactos/base/applications/mplay32/lang/en-US.rc index e4b0898afe6..3dc25d1b164 100644 --- a/reactos/base/applications/mplay32/lang/en-US.rc +++ b/reactos/base/applications/mplay32/lang/en-US.rc @@ -22,6 +22,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/es-ES.rc b/reactos/base/applications/mplay32/lang/es-ES.rc index b386f98eb83..76726b317c1 100644 --- a/reactos/base/applications/mplay32/lang/es-ES.rc +++ b/reactos/base/applications/mplay32/lang/es-ES.rc @@ -22,6 +22,7 @@ BEGIN END POPUP "&Dispositivo" BEGIN + MENUITEM SEPARATOR MENUITEM "&Propiedades", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "Control de &volumen", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/fr-FR.rc b/reactos/base/applications/mplay32/lang/fr-FR.rc index c29ee2d451e..d7eaa044305 100644 --- a/reactos/base/applications/mplay32/lang/fr-FR.rc +++ b/reactos/base/applications/mplay32/lang/fr-FR.rc @@ -22,6 +22,7 @@ BEGIN END POPUP "Périp&hérique" BEGIN + MENUITEM SEPARATOR MENUITEM "&Propriétés", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "Contrôle du &volume", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/he-IL.rc b/reactos/base/applications/mplay32/lang/he-IL.rc index e4430854bd2..246488084c2 100644 --- a/reactos/base/applications/mplay32/lang/he-IL.rc +++ b/reactos/base/applications/mplay32/lang/he-IL.rc @@ -22,6 +22,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/it-IT.rc b/reactos/base/applications/mplay32/lang/it-IT.rc index 09f5202d8b1..34d0aa7cadf 100644 --- a/reactos/base/applications/mplay32/lang/it-IT.rc +++ b/reactos/base/applications/mplay32/lang/it-IT.rc @@ -22,6 +22,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/ja-JP.rc b/reactos/base/applications/mplay32/lang/ja-JP.rc index 3c07586fd83..21217cf9023 100644 --- a/reactos/base/applications/mplay32/lang/ja-JP.rc +++ b/reactos/base/applications/mplay32/lang/ja-JP.rc @@ -22,6 +22,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/nl-NL.rc b/reactos/base/applications/mplay32/lang/nl-NL.rc index e71afa12212..09f8ca41a40 100644 --- a/reactos/base/applications/mplay32/lang/nl-NL.rc +++ b/reactos/base/applications/mplay32/lang/nl-NL.rc @@ -22,6 +22,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/no-NO.rc b/reactos/base/applications/mplay32/lang/no-NO.rc index f0056fe00a3..1ddc2bd868b 100644 --- a/reactos/base/applications/mplay32/lang/no-NO.rc +++ b/reactos/base/applications/mplay32/lang/no-NO.rc @@ -22,6 +22,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/pl-PL.rc b/reactos/base/applications/mplay32/lang/pl-PL.rc index 2a47d976bea..a210973a057 100644 --- a/reactos/base/applications/mplay32/lang/pl-PL.rc +++ b/reactos/base/applications/mplay32/lang/pl-PL.rc @@ -30,6 +30,7 @@ BEGIN END POPUP "&Urządzenie" BEGIN + MENUITEM SEPARATOR MENUITEM "Właś&ciwości", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Regulacja głośności", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/pt-BR.rc b/reactos/base/applications/mplay32/lang/pt-BR.rc index d9b5f5086f1..d37f0f0d559 100644 --- a/reactos/base/applications/mplay32/lang/pt-BR.rc +++ b/reactos/base/applications/mplay32/lang/pt-BR.rc @@ -24,6 +24,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/ro-RO.rc b/reactos/base/applications/mplay32/lang/ro-RO.rc index aa3b29599aa..70ee6a0ddb0 100644 --- a/reactos/base/applications/mplay32/lang/ro-RO.rc +++ b/reactos/base/applications/mplay32/lang/ro-RO.rc @@ -28,6 +28,7 @@ BEGIN END POPUP "&Dispozitiv" BEGIN + MENUITEM SEPARATOR MENUITEM "&Proprietăți…", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "Control &volum…", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/ru-RU.rc b/reactos/base/applications/mplay32/lang/ru-RU.rc index 57a893fc9a0..a7b0b4ab616 100644 --- a/reactos/base/applications/mplay32/lang/ru-RU.rc +++ b/reactos/base/applications/mplay32/lang/ru-RU.rc @@ -22,6 +22,7 @@ BEGIN END POPUP "&Устройство" BEGIN + MENUITEM SEPARATOR MENUITEM "&Свойства", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Громкость", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/sk-SK.rc b/reactos/base/applications/mplay32/lang/sk-SK.rc index 895a5855e3f..ac6835e54cf 100644 --- a/reactos/base/applications/mplay32/lang/sk-SK.rc +++ b/reactos/base/applications/mplay32/lang/sk-SK.rc @@ -27,6 +27,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/sq-AL.rc b/reactos/base/applications/mplay32/lang/sq-AL.rc index b3eb5022691..aa63c982a68 100644 --- a/reactos/base/applications/mplay32/lang/sq-AL.rc +++ b/reactos/base/applications/mplay32/lang/sq-AL.rc @@ -26,6 +26,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/sv-SE.rc b/reactos/base/applications/mplay32/lang/sv-SE.rc index 9e9fb5c1582..c184729716f 100644 --- a/reactos/base/applications/mplay32/lang/sv-SE.rc +++ b/reactos/base/applications/mplay32/lang/sv-SE.rc @@ -29,6 +29,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/tr-TR.rc b/reactos/base/applications/mplay32/lang/tr-TR.rc index 4368980e93a..d85e381085d 100644 --- a/reactos/base/applications/mplay32/lang/tr-TR.rc +++ b/reactos/base/applications/mplay32/lang/tr-TR.rc @@ -24,6 +24,7 @@ BEGIN END POPUP "&Aygıt" BEGIN + MENUITEM SEPARATOR MENUITEM "&Husûsiyetler", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Ses Düzeyi Denetimi", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/uk-UA.rc b/reactos/base/applications/mplay32/lang/uk-UA.rc index b5d3ead130c..c8066273b87 100644 --- a/reactos/base/applications/mplay32/lang/uk-UA.rc +++ b/reactos/base/applications/mplay32/lang/uk-UA.rc @@ -30,6 +30,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/zh-CN.rc b/reactos/base/applications/mplay32/lang/zh-CN.rc index 9b25bd2cb28..ace824ec2c4 100644 --- a/reactos/base/applications/mplay32/lang/zh-CN.rc +++ b/reactos/base/applications/mplay32/lang/zh-CN.rc @@ -24,6 +24,7 @@ BEGIN END POPUP "设备(&D)" BEGIN + MENUITEM SEPARATOR MENUITEM "属性(&P)", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "音量控制(&V)", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/lang/zh-TW.rc b/reactos/base/applications/mplay32/lang/zh-TW.rc index 4cd5bda85ea..2517925ecd2 100644 --- a/reactos/base/applications/mplay32/lang/zh-TW.rc +++ b/reactos/base/applications/mplay32/lang/zh-TW.rc @@ -30,6 +30,7 @@ BEGIN END POPUP "&Device" BEGIN + MENUITEM SEPARATOR MENUITEM "&Properties", IDM_DEVPROPS MENUITEM SEPARATOR MENUITEM "&Volume Control", IDM_VOLUMECTL diff --git a/reactos/base/applications/mplay32/mplay32.c b/reactos/base/applications/mplay32/mplay32.c index 95e03b66a93..46f33d4846c 100644 --- a/reactos/base/applications/mplay32/mplay32.c +++ b/reactos/base/applications/mplay32/mplay32.c @@ -483,6 +483,38 @@ GetDeviceFriendlyName(LPTSTR lpDeviceName, LPTSTR lpFriendlyName, DWORD dwFriend return mciError; } +static BOOL +DeviceUsesFiles(LPTSTR lpDeviceName) +{ + MCIERROR mciError; + MCI_OPEN_PARMS mciOpen; + MCI_GETDEVCAPS_PARMS mciDevCaps; + MCI_GENERIC_PARMS mciGeneric; + + mciOpen.dwCallback = 0; + mciOpen.wDeviceID = 0; + mciOpen.lpstrDeviceType = lpDeviceName; + mciOpen.lpstrElementName = NULL; + mciOpen.lpstrAlias = NULL; + + mciError = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_WAIT, (DWORD_PTR)&mciOpen); + if (mciError != 0) + return FALSE; + + mciDevCaps.dwCallback = 0; + mciDevCaps.dwReturn = 0; + mciDevCaps.dwItem = MCI_GETDEVCAPS_USES_FILES; + + mciError = mciSendCommand(mciOpen.wDeviceID, MCI_GETDEVCAPS, MCI_WAIT | MCI_GETDEVCAPS_ITEM, (DWORD_PTR)&mciDevCaps); + if (mciError != 0) + return FALSE; + + mciGeneric.dwCallback = 0; + mciSendCommand(mciOpen.wDeviceID, MCI_CLOSE, MCI_WAIT, (DWORD_PTR)&mciGeneric); + + return (BOOL)mciDevCaps.dwReturn; +} + static MCIERROR CloseMciDevice(VOID) { @@ -509,7 +541,7 @@ OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName) MCIERROR mciError; MCI_STATUS_PARMS mciStatus; MCI_OPEN_PARMS mciOpen; - DWORD dwFlags = MCI_OPEN_ELEMENT | MCI_WAIT; + DWORD dwFlags = MCI_WAIT; LPTSTR lpStr; if (wDeviceId) @@ -524,6 +556,9 @@ OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName) if (lpType) dwFlags |= MCI_OPEN_TYPE; + if (lpFileName) + dwFlags |= MCI_OPEN_ELEMENT; + mciError = mciSendCommand(0, MCI_OPEN, dwFlags, (DWORD_PTR)&mciOpen); if (mciError != 0) return mciError; @@ -562,11 +597,16 @@ OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName) /* NOTE: Everything above this line may be done instead in OpenMediaFile() */ - lpStr = _tcsrchr(lpFileName, _T('\\')); - if (lpStr) // Get only the file name (skip the last path separator) - lpStr++; + if (lpFileName) + { + lpStr = _tcsrchr(lpFileName, _T('\\')); + if (lpStr) // Get only the file name (skip the last path separator) + lpStr++; + else + lpStr = lpFileName; + } else - lpStr = lpFileName; + lpStr = lpType; StringCbCopy(szCurrentFile, sizeof(szCurrentFile), lpStr); @@ -852,7 +892,7 @@ CloseMediaFile(HWND hwnd) } static VOID -OpenMediaFile(HWND hwnd, LPTSTR lpFileName) +OpenMediaFile(HWND hwnd, LPTSTR lpFileName, LPTSTR lpType) { MCIERROR mciError; @@ -862,7 +902,7 @@ OpenMediaFile(HWND hwnd, LPTSTR lpFileName) if (wDeviceId) CloseMediaFile(hwnd); - mciError = OpenMciDevice(hwnd, NULL, lpFileName); + mciError = OpenMciDevice(hwnd, lpType, lpFileName); if (mciError != 0) { ShowMCIError(hwnd, mciError); @@ -872,8 +912,45 @@ OpenMediaFile(HWND hwnd, LPTSTR lpFileName) StartPlayback(hwnd); } +static DWORD +InsertDeviceMenuItem(HMENU hMenu, UINT uItem, BOOL fByPosition, UINT uItemID, DWORD dwDeviceIndex) +{ + MENUITEMINFO lpmii; + MCIERROR mciError; + TCHAR szDeviceName[MAX_MCISTR]; + TCHAR szFriendlyName[MAX_MCISTR]; + + mciError = GetDeviceName(dwDeviceIndex, szDeviceName, sizeof(szDeviceName)); + if (mciError) + { + return mciError; + } + + mciError = GetDeviceFriendlyName(szDeviceName, szFriendlyName, sizeof(szFriendlyName)); + if (mciError) + { + return mciError; + } + + if (DeviceUsesFiles(szDeviceName)) + { + StringCbCat(szFriendlyName, sizeof(szFriendlyName), _T("...")); + } + + ZeroMemory(&lpmii, sizeof(MENUITEMINFO)); + lpmii.cbSize = sizeof(lpmii); + lpmii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID; + lpmii.wID = uItemID; + lpmii.fType = MF_STRING; + lpmii.dwTypeData = szFriendlyName; + lpmii.dwItemData = dwDeviceIndex; + InsertMenuItem(hMenu, uItem, fByPosition, &lpmii); + + return 0; +} + static VOID -BuildFileFilter(VOID) +BuildFileFilterAndDeviceMenu(VOID) { TCHAR szDeviceName[MAX_MCISTR]; TCHAR szFriendlyName[MAX_MCISTR]; @@ -891,6 +968,7 @@ BuildFileFilter(VOID) DWORD dwFilterSize; DWORD dwDeviceSize; DWORD dwExtensionLen; + DWORD dwPosition = 0; DWORD i; DWORD j; UINT uSizeRemain; @@ -953,6 +1031,10 @@ BuildFileFilter(VOID) continue; } + /* Insert a menu item under the "Device" menu for every found MCI device */ + InsertDeviceMenuItem(GetSubMenu(hMainMenu, 3), dwPosition, TRUE, IDM_DEVICE_FIRST + dwPosition, j); + dwPosition++; + /* Copy the default extension list, that may be overwritten after... */ StringCbCopy(szExtensionList, dwMaskLen * sizeof(TCHAR), szDefaultExtension); @@ -1065,7 +1147,7 @@ CleanupFileFilter(VOID) } static VOID -OpenFileDialog(HWND hwnd) +OpenFileDialog(HWND hwnd, DWORD dwFilterIndex, LPTSTR lpType) { OPENFILENAME OpenFileName; TCHAR szFile[MAX_PATH + 1] = _T(""); @@ -1087,11 +1169,46 @@ OpenFileDialog(HWND hwnd) OpenFileName.lpstrInitialDir = szCurrentDir; OpenFileName.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_SHAREAWARE; OpenFileName.lpstrDefExt = _T("\0"); + OpenFileName.nFilterIndex = dwFilterIndex; if (!GetOpenFileName(&OpenFileName)) return; - OpenMediaFile(hwnd, OpenFileName.lpstrFile); + OpenMediaFile(hwnd, OpenFileName.lpstrFile, lpType); +} + +static VOID +HandleDeviceMenuItem(HWND hwnd, UINT uItem) +{ + MENUITEMINFO lpmii; + TCHAR szDeviceName[MAX_MCISTR]; + MCIERROR mciError; + + ZeroMemory(&lpmii, sizeof(MENUITEMINFO)); + lpmii.cbSize = sizeof(lpmii); + lpmii.fMask = MIIM_DATA; + GetMenuItemInfo(hMainMenu, uItem, FALSE, &lpmii); + + mciError = GetDeviceName(lpmii.dwItemData, szDeviceName, sizeof(szDeviceName)); + if (mciError) + { + ShowMCIError(hwnd, mciError); + return; + } + + if (DeviceUsesFiles(szDeviceName)) + { + OpenFileDialog(hwnd, uItem - IDM_DEVICE_FIRST + 1, szDeviceName); + return; + } + + mciError = OpenMciDevice(hwnd, szDeviceName, NULL); + if (mciError) + { + ShowMCIError(hwnd, mciError); + } + + return; } LRESULT CALLBACK @@ -1114,7 +1231,7 @@ MainWndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) drophandle = (HDROP)wParam; DragQueryFile(drophandle, 0, droppedfile, ARRAYSIZE(droppedfile)); DragFinish(drophandle); - OpenMediaFile(hwnd, droppedfile); + OpenMediaFile(hwnd, droppedfile, NULL); break; } @@ -1241,6 +1358,12 @@ MainWndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) case WM_COMMAND: { + if (LOWORD(wParam) >= IDM_DEVICE_FIRST) + { + HandleDeviceMenuItem(hwnd, LOWORD(wParam)); + break; + } + switch (LOWORD(wParam)) { case IDC_PLAY: @@ -1249,7 +1372,7 @@ MainWndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) if (wDeviceId) TogglePlaybackState(hwnd); else - OpenFileDialog(hwnd); + OpenFileDialog(hwnd, 1, NULL); break; } @@ -1276,7 +1399,7 @@ MainWndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) break; case IDM_OPEN_FILE: - OpenFileDialog(hwnd); + OpenFileDialog(hwnd, 1, NULL); return 0; case IDM_CLOSE_FILE: @@ -1383,7 +1506,7 @@ _tWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPTSTR lpCmdLine, INT nCmdShow) hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(ID_ACCELERATORS)); - BuildFileFilter(); + BuildFileFilterAndDeviceMenu(); DragAcceptFiles(hwnd, TRUE); @@ -1399,7 +1522,7 @@ _tWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPTSTR lpCmdLine, INT nCmdShow) ShowWindow(hwnd, SW_SHOW); UpdateWindow(hwnd); - OpenMediaFile(hwnd, lpCmdLine); + OpenMediaFile(hwnd, lpCmdLine, NULL); /* Message Loop */ while (GetMessage(&msg, NULL, 0, 0)) diff --git a/reactos/base/applications/mplay32/resource.h b/reactos/base/applications/mplay32/resource.h index c1150c06727..7a0276fafdd 100644 --- a/reactos/base/applications/mplay32/resource.h +++ b/reactos/base/applications/mplay32/resource.h @@ -52,6 +52,9 @@ #define IDM_REPEAT 1006 #define IDM_SWITCHVIEW 1007 +/* The device specific items in the device menu start here */ +#define IDM_DEVICE_FIRST 10000 + /* ToolBar Icons */ #define TBICON_PLAY 0 #define TBICON_STOP 1