|
Customizing the Recording Process
You can customize the recording process, taking complete control of most
everything from creating the MCIWnd window to saving the recorded information in a file.
The following example queries the MCI device for recording and saving
capabilities, and includes menu commands to record at the beginning or end of the
content.
The following example uses the MCIWndCreate function to create a new window and allows you to specify an existing file to
store the recorded data and the MCIWndNew macro to associate a new file with the window. Alternatively, you can use the MCIWndOpen or MCIWndOpenDialog macro to specify a file.
The example uses the MCIWndCanRecord macro to verify that the device can record and the MCIWndCanSave macro to verify that the device save information. The example sets the
current playback position by using the MCIWndHome and MCIWndEnd macros. The example starts recording by using the MCIWndRecord macro. After the information is recorded, the example saves it by using the MCIWndSaveDialog macro.
case WM_COMMAND:
switch (wParam)
{
case IDM_CREATEMCIWND:
g_hwndMCIWnd = MCIWndCreate( hwnd, g_hinst,
WS_VISIBLE | WS_CHILD |
MCIWNDF_RECORD, // add Record button
NULL );
MCIWndNew(g_hwndMCIWnd, "waveaudio"); // new file
if( MCIWndCanRecord(g_hwndMCIWnd) )
{
MessageBox( hwnd,
"Press the red button on the toolbar to record.",
"MCIWnd Record",
MB_OK );
}
else
{
MessageBox( hwnd,
"This device doesn't record.",
"MCIWnd Record",
MB_OK );
}
break;
case IDM_RECORDATSTART:
if( MCIWndCanRecord(g_hwndMCIWnd) )
{
MCIWndHome(g_hwndMCIWnd);
MCIWndRecord(g_hwndMCIWnd);
}
else
{
MessageBox( hwnd,
"This device doesn't record.",
"MCIWnd Record",
MB_OK);
}
break;
case IDM_RECORDATEND:
if( MCIWndCanRecord(g_hwndMCIWnd) )
{
MCIWndEnd(g_hwndMCIWnd);
MCIWndRecord(g_hwndMCIWnd);
}
else
{
MessageBox( hwnd,
"This device doesn't record.",
"MCIWnd Record",
MB_OK);
}
break;
case IDM_SAVEMCIWND:
if( MCIWndCanSave(g_hwndMCIWnd) )
MCIWndSaveDialog(g_hwndMCIWnd);
}
break;
// Handle other messages here.
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|