Accueil > > > MOTEUR AUDIO TEMPS REEL AVEC GESTION DU VOLUME
MOTEUR AUDIO TEMPS REEL AVEC GESTION DU VOLUME
Information sur la source
Description
Permet de faire passer par un buffer l'entrée ligne et l'envoyer à la sortie carte son en réglant le volume.
Suite du développement: equalizer, analyse de spectre
Source
-
- // base.cpp
-
- #include "stdafx.h"
- #include "base.h"
-
- BOOL OpenedIn = FALSE;
- HANDLE recordDone;
- HWAVEIN hWaveIn;
- DWORD threadidIn;
- HANDLE RecordHandle;
- PWAVEHDR pWaveHeaderIn[NB_BUFFER];
-
- BOOL OpenedOut = FALSE;
- HANDLE playDone;
- HWAVEOUT hWaveOut;
- DWORD threadidOut;
- HANDLE PlayHandle;
- PWAVEHDR pWaveHeaderOut[NB_BUFFER];
-
- short Buffer[TAILLE_BLOC * CANAUX];
-
- HWND DlgMain;
-
- CRITICAL_SECTION CriticalSection;
- int volume_general; // 0 a 1000
-
- //****************************************************************************
-
- void CALLBACK waveInProc(HWAVEIN hwi, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2)
- {
- if (uMsg == WIM_OPEN)
- {
- MessageBox(DlgMain,"WIM_OPEN","RTA",MB_OK);
- OpenedIn = TRUE;
- }
-
- if (uMsg == WIM_CLOSE)
- {
- MessageBox(DlgMain,"WIM_CLOSE","RTA",MB_OK);
- }
-
- if (uMsg == WIM_DATA)
- {
- SetEvent(recordDone);
- }
- }
-
- //****************************************************************************
- // 01 WHDR_DONE indique que c'est fini avec ce buffer.
- // 02 WHDR_PREPARED indique que le buffer a ete prepare (waveInPrepareHeader ou waveOutPrepareHeader)
- // 04 WHDR_BEGINLOOP indique que ce buffer est le premier dans une boucle, drapeau utilisé seulement en sortie.
- // 08 WHDR_ENDLOOP indique que ce buffer est le dernier dans une boucle. Ce drapeau est utilisé seulement en sortie.
- // 10 WHDR_INQUEUE indique que le buffer est mis en queue pour la sortie.
- //****************************************************************************
-
- DWORD WINAPI InThreadProc(LPVOID lpParam)
- {
- int wbi=0;
-
- __1: WaitForSingleObject(recordDone, INFINITE);
- if (pWaveHeaderIn[wbi]->dwFlags & WHDR_DONE)
- {
- EnterCriticalSection(&CriticalSection);
- copier_buffer(Buffer, (short *)pWaveHeaderIn[wbi]->lpData, TAILLE_BLOC * CANAUX); // sauvegarder bloc recu
- waveInUnprepareHeader(hWaveIn, pWaveHeaderIn[wbi], sizeof(WAVEHDR));
- pWaveHeaderIn[wbi]->dwFlags = 0;
- waveInPrepareHeader(hWaveIn, pWaveHeaderIn[wbi], sizeof(WAVEHDR));
- waveInAddBuffer(hWaveIn, pWaveHeaderIn[wbi], sizeof(WAVEHDR));
-
- __asm // modulo
- {
- mov eax, wbi
- mov ebx, NB_BUFFER
- inc eax
- cmp eax, ebx
- jb fin1
- xor eax, eax
- fin1: mov wbi, eax
- }
- LeaveCriticalSection(&CriticalSection );
- }
-
- __asm
- {
- jmp __1
- }
-
- waveInReset(hWaveIn);
- waveInClose(hWaveIn);
- MessageBox(DlgMain,"FIN","RTA",MB_OK);
- OpenedIn = FALSE;
- return 0;
- }
-
- //****************************************************************************
-
- void CALLBACK waveOutProc(HWAVEOUT hwo, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2)
- {
- if (uMsg == WOM_OPEN)
- {
- MessageBox(DlgMain,"WOM_OPEN","RTA",MB_OK);
- OpenedOut = TRUE;
- }
-
- if (uMsg == WOM_CLOSE)
- {
- MessageBox(DlgMain,"WOM_CLOSE","RTA",MB_OK);
- }
-
- if (uMsg == WOM_DONE)
- {
- SetEvent(playDone);
- }
- }
-
- //****************************************************************************
-
- DWORD WINAPI OutThreadProc(LPVOID lpParam)
- {
- int wbo=0;
-
- __1:WaitForSingleObject(playDone, INFINITE);
-
- if (pWaveHeaderOut[wbo]->dwFlags & WHDR_DONE)
- {
- waveOutUnprepareHeader(hWaveOut, pWaveHeaderOut[wbo], sizeof(WAVEHDR));
- pWaveHeaderOut[wbo]->dwFlags = 0;
-
- regler_volume(Buffer, volume_general, 1000.0, TAILLE_BLOC * CANAUX); // appliquer le volume avant de l'envoyer
- copier_buffer((short *)pWaveHeaderOut[wbo]->lpData, Buffer, TAILLE_BLOC * CANAUX); // reprendre bloc recu
- waveOutPrepareHeader(hWaveOut, pWaveHeaderOut[wbo], sizeof(WAVEHDR));
- waveOutWrite(hWaveOut, pWaveHeaderOut[wbo], sizeof(WAVEHDR));
-
- __asm
- {
- mov eax, wbo
- mov ebx, NB_BUFFER
- inc eax
- cmp eax, ebx
- jb fin1
- xor eax, eax
- fin1: mov wbo, eax
- }
-
- }
-
- __asm
- {
- jmp __1
- }
-
-
-
-
-
- return 0;
- }
-
- //****************************************************************************
-
- int OuvrirPeripheriques()
- {
- int i;
- WAVEFORMATEX WaveFormat;
-
- WaveFormat.nChannels = CANAUX; // 1 pour mono 2 pour stereo
- WaveFormat.wBitsPerSample = 16; // 16 bit
- WaveFormat.nAvgBytesPerSec = SAMPLERATE * WaveFormat.nChannels * WaveFormat.wBitsPerSample/8; // nombre d'octets par seconde
- WaveFormat.wFormatTag = 1; // 1 pour PCM
- WaveFormat.nSamplesPerSec = SAMPLERATE; // frequence d'echantillonnage
- WaveFormat.nBlockAlign = 1;
- WaveFormat.cbSize = 0;
-
- for(i=0; i<NB_BUFFER; i++)
- {
- pWaveHeaderIn[i] = (PWAVEHDR) malloc(sizeof(WAVEHDR));
- }
-
- InitializeCriticalSection(&CriticalSection);
-
- if (waveInOpen(&hWaveIn, WAVE_MAPPER, &WaveFormat, (DWORD)waveInProc, (DWORD)&CriticalSection, CALLBACK_FUNCTION))
- {
- MessageBox(DlgMain,"Ouverture périphérique d'entrée impossible","RTA",MB_OK);
- return 0;
- }
-
- for(i=0; i<NB_BUFFER; i++)
- {
- pWaveHeaderIn[i]->lpData = (LPSTR) malloc(BUFFER_SIZE); // reserve des octets et non des short
- pWaveHeaderIn[i]->dwBufferLength = BUFFER_SIZE;
- pWaveHeaderIn[i]->dwBytesRecorded = 0;
- pWaveHeaderIn[i]->dwUser = 0;
- pWaveHeaderIn[i]->dwFlags = 0;
- pWaveHeaderIn[i]->dwLoops = 0;
- pWaveHeaderIn[i]->lpNext = NULL;
- pWaveHeaderIn[i]->reserved = 0;
- }
-
- for(i=0; i<NB_BUFFER; i++)
- {
- if (waveInPrepareHeader(hWaveIn, pWaveHeaderIn[i], sizeof(WAVEHDR)))
- {
- MessageBox(DlgMain,"Erreur waveInPrepareHeader","RTA",MB_OK);
- return 0;
- }
- }
-
- for(i=0; i<NB_BUFFER; i++)
- {
- if (waveInAddBuffer(hWaveIn, pWaveHeaderIn[i], sizeof(WAVEHDR)))
- {
- MessageBox(DlgMain,"Erreur AddBuffer","RTA",MB_OK);
- return 0;
- }
- }
-
- ResetEvent(recordDone);
-
- if (waveInStart(hWaveIn))
- {
- waveInClose(hWaveIn);
- }
-
-
-
- //****
- for(i=0; i<NB_BUFFER; i++)
- {
- pWaveHeaderOut[i] = (PWAVEHDR) malloc(sizeof(WAVEHDR));
- }
-
- if (waveOutOpen(&hWaveOut, WAVE_MAPPER, &WaveFormat, (DWORD)waveOutProc, 0L, CALLBACK_FUNCTION))
- {
- MessageBox(DlgMain,"Ouverture périphérique de sortie impossible","RTA",MB_OK);
- return 0;
- }
-
- for(i=0; i<NB_BUFFER; i++)
- {
- pWaveHeaderOut[i]->lpData = (LPSTR) malloc(BUFFER_SIZE); // reserve des octets et non des short
- pWaveHeaderOut[i]->dwBufferLength = BUFFER_SIZE;
- pWaveHeaderOut[i]->dwBytesRecorded = 0;
- pWaveHeaderOut[i]->dwUser = 0;
- pWaveHeaderOut[i]->dwFlags = 0;
- pWaveHeaderOut[i]->dwLoops = 0;
- pWaveHeaderOut[i]->lpNext = NULL;
- pWaveHeaderOut[i]->reserved = 0;
- }
-
- for(i=0; i<NB_BUFFER; i++)
- {
- if (waveOutPrepareHeader(hWaveOut, pWaveHeaderOut[i], sizeof(WAVEHDR)))
- {
- MessageBox(DlgMain,"Erreur PrepareHeader","RTA",MB_OK);
- return 0;
- }
- }
-
- for(i=0; i<NB_BUFFER; i++)
- {
- if (waveOutWrite(hWaveOut, pWaveHeaderOut[i], sizeof(WAVEHDR)))
- {
- MessageBox(DlgMain,"Erreur OutWrite","RTA",MB_OK);
- return 0;
- }
- }
- ResetEvent(playDone);
- //*******
-
-
- return 0;
- }
-
- //****************************************************************************
-
- BOOL CALLBACK DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- if (msg == WM_INITDIALOG)
- {
- DlgMain = hWnd;
-
- char str[128];
-
- SendDlgItemMessage(hWnd,IDC_SLIDER_VOLUME,TBM_SETRANGEMAX,0,1000);
- SendDlgItemMessage(hWnd,IDC_SLIDER_VOLUME,TBM_SETRANGEMIN,0,0);
- SendDlgItemMessage(hWnd,IDC_SLIDER_VOLUME,TBM_SETPOS,1,0); // volume general a fond
- volume_general = 1000-SendDlgItemMessage(hWnd,IDC_SLIDER_VOLUME,TBM_GETPOS,0,0);
- sprintf(str,"volume: %1.1f dB",20*log10(volume_general/1000));
- SetDlgItemText(hWnd,IDC_STATIC_VOLUME,str);
-
- return 0;
- }
-
-
-
-
- if (msg == WM_VSCROLL)
- {
- char str[128];
-
- volume_general = 1000-SendDlgItemMessage(hWnd,IDC_SLIDER_VOLUME,TBM_GETPOS,0,0);
- if (volume_general == 0)
- {
- sprintf(str,"volume: -oo");
- SetDlgItemText(hWnd,IDC_STATIC_VOLUME,str);
- return 0;
- }
- sprintf(str,"volume: %1.1f dB", 20*log10(volume_general/1000.0));
- SetDlgItemText(hWnd,IDC_STATIC_VOLUME,str);
- return 0;
- }
-
-
-
-
- if (msg == WM_COMMAND)
- {
- if (wParam == IDC_START)
- {
- if(OpenedIn == TRUE)
- {
- MessageBox(DlgMain,"Déjà ouvert","RTA",MB_OK);
- return 0;
- }
- recordDone = CreateEvent(0, FALSE, FALSE, 0);
- ResetEvent(recordDone);
- RecordHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) InThreadProc, NULL, 0, &threadidIn);
-
- playDone = CreateEvent(0, FALSE, FALSE, 0);
- ResetEvent(playDone);
- PlayHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) OutThreadProc, NULL, 0, &threadidOut);
-
- OuvrirPeripheriques();
- return 0;
- }
-
- if (wParam == IDCANCEL)
- {
- EndDialog(hWnd, 0);
- return 0;
- }
- }
-
-
-
-
- return 0;
- }
-
- //****************************************************************************
-
- int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
- {
- HANDLE hMutex;
- hMutex = CreateMutex (NULL,FALSE, "RTA");
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- MessageBox(NULL,"Cette application est déjà présente en mémoire !","WARNING",MB_OK|MB_ICONEXCLAMATION);
- return 0;
- }
-
- InitCommonControls();
- DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1),HWND_DESKTOP,DlgProc);
- return 0;
- }
-
- //*******************************************************
// base.cpp
#include "stdafx.h"
#include "base.h"
BOOL OpenedIn = FALSE;
HANDLE recordDone;
HWAVEIN hWaveIn;
DWORD threadidIn;
HANDLE RecordHandle;
PWAVEHDR pWaveHeaderIn[NB_BUFFER];
BOOL OpenedOut = FALSE;
HANDLE playDone;
HWAVEOUT hWaveOut;
DWORD threadidOut;
HANDLE PlayHandle;
PWAVEHDR pWaveHeaderOut[NB_BUFFER];
short Buffer[TAILLE_BLOC * CANAUX];
HWND DlgMain;
CRITICAL_SECTION CriticalSection;
int volume_general; // 0 a 1000
//****************************************************************************
void CALLBACK waveInProc(HWAVEIN hwi, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2)
{
if (uMsg == WIM_OPEN)
{
MessageBox(DlgMain,"WIM_OPEN","RTA",MB_OK);
OpenedIn = TRUE;
}
if (uMsg == WIM_CLOSE)
{
MessageBox(DlgMain,"WIM_CLOSE","RTA",MB_OK);
}
if (uMsg == WIM_DATA)
{
SetEvent(recordDone);
}
}
//****************************************************************************
// 01 WHDR_DONE indique que c'est fini avec ce buffer.
// 02 WHDR_PREPARED indique que le buffer a ete prepare (waveInPrepareHeader ou waveOutPrepareHeader)
// 04 WHDR_BEGINLOOP indique que ce buffer est le premier dans une boucle, drapeau utilisé seulement en sortie.
// 08 WHDR_ENDLOOP indique que ce buffer est le dernier dans une boucle. Ce drapeau est utilisé seulement en sortie.
// 10 WHDR_INQUEUE indique que le buffer est mis en queue pour la sortie.
//****************************************************************************
DWORD WINAPI InThreadProc(LPVOID lpParam)
{
int wbi=0;
__1: WaitForSingleObject(recordDone, INFINITE);
if (pWaveHeaderIn[wbi]->dwFlags & WHDR_DONE)
{
EnterCriticalSection(&CriticalSection);
copier_buffer(Buffer, (short *)pWaveHeaderIn[wbi]->lpData, TAILLE_BLOC * CANAUX); // sauvegarder bloc recu
waveInUnprepareHeader(hWaveIn, pWaveHeaderIn[wbi], sizeof(WAVEHDR));
pWaveHeaderIn[wbi]->dwFlags = 0;
waveInPrepareHeader(hWaveIn, pWaveHeaderIn[wbi], sizeof(WAVEHDR));
waveInAddBuffer(hWaveIn, pWaveHeaderIn[wbi], sizeof(WAVEHDR));
__asm // modulo
{
mov eax, wbi
mov ebx, NB_BUFFER
inc eax
cmp eax, ebx
jb fin1
xor eax, eax
fin1: mov wbi, eax
}
LeaveCriticalSection(&CriticalSection );
}
__asm
{
jmp __1
}
waveInReset(hWaveIn);
waveInClose(hWaveIn);
MessageBox(DlgMain,"FIN","RTA",MB_OK);
OpenedIn = FALSE;
return 0;
}
//****************************************************************************
void CALLBACK waveOutProc(HWAVEOUT hwo, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2)
{
if (uMsg == WOM_OPEN)
{
MessageBox(DlgMain,"WOM_OPEN","RTA",MB_OK);
OpenedOut = TRUE;
}
if (uMsg == WOM_CLOSE)
{
MessageBox(DlgMain,"WOM_CLOSE","RTA",MB_OK);
}
if (uMsg == WOM_DONE)
{
SetEvent(playDone);
}
}
//****************************************************************************
DWORD WINAPI OutThreadProc(LPVOID lpParam)
{
int wbo=0;
__1:WaitForSingleObject(playDone, INFINITE);
if (pWaveHeaderOut[wbo]->dwFlags & WHDR_DONE)
{
waveOutUnprepareHeader(hWaveOut, pWaveHeaderOut[wbo], sizeof(WAVEHDR));
pWaveHeaderOut[wbo]->dwFlags = 0;
regler_volume(Buffer, volume_general, 1000.0, TAILLE_BLOC * CANAUX); // appliquer le volume avant de l'envoyer
copier_buffer((short *)pWaveHeaderOut[wbo]->lpData, Buffer, TAILLE_BLOC * CANAUX); // reprendre bloc recu
waveOutPrepareHeader(hWaveOut, pWaveHeaderOut[wbo], sizeof(WAVEHDR));
waveOutWrite(hWaveOut, pWaveHeaderOut[wbo], sizeof(WAVEHDR));
__asm
{
mov eax, wbo
mov ebx, NB_BUFFER
inc eax
cmp eax, ebx
jb fin1
xor eax, eax
fin1: mov wbo, eax
}
}
__asm
{
jmp __1
}
return 0;
}
//****************************************************************************
int OuvrirPeripheriques()
{
int i;
WAVEFORMATEX WaveFormat;
WaveFormat.nChannels = CANAUX; // 1 pour mono 2 pour stereo
WaveFormat.wBitsPerSample = 16; // 16 bit
WaveFormat.nAvgBytesPerSec = SAMPLERATE * WaveFormat.nChannels * WaveFormat.wBitsPerSample/8; // nombre d'octets par seconde
WaveFormat.wFormatTag = 1; // 1 pour PCM
WaveFormat.nSamplesPerSec = SAMPLERATE; // frequence d'echantillonnage
WaveFormat.nBlockAlign = 1;
WaveFormat.cbSize = 0;
for(i=0; i<NB_BUFFER; i++)
{
pWaveHeaderIn[i] = (PWAVEHDR) malloc(sizeof(WAVEHDR));
}
InitializeCriticalSection(&CriticalSection);
if (waveInOpen(&hWaveIn, WAVE_MAPPER, &WaveFormat, (DWORD)waveInProc, (DWORD)&CriticalSection, CALLBACK_FUNCTION))
{
MessageBox(DlgMain,"Ouverture périphérique d'entrée impossible","RTA",MB_OK);
return 0;
}
for(i=0; i<NB_BUFFER; i++)
{
pWaveHeaderIn[i]->lpData = (LPSTR) malloc(BUFFER_SIZE); // reserve des octets et non des short
pWaveHeaderIn[i]->dwBufferLength = BUFFER_SIZE;
pWaveHeaderIn[i]->dwBytesRecorded = 0;
pWaveHeaderIn[i]->dwUser = 0;
pWaveHeaderIn[i]->dwFlags = 0;
pWaveHeaderIn[i]->dwLoops = 0;
pWaveHeaderIn[i]->lpNext = NULL;
pWaveHeaderIn[i]->reserved = 0;
}
for(i=0; i<NB_BUFFER; i++)
{
if (waveInPrepareHeader(hWaveIn, pWaveHeaderIn[i], sizeof(WAVEHDR)))
{
MessageBox(DlgMain,"Erreur waveInPrepareHeader","RTA",MB_OK);
return 0;
}
}
for(i=0; i<NB_BUFFER; i++)
{
if (waveInAddBuffer(hWaveIn, pWaveHeaderIn[i], sizeof(WAVEHDR)))
{
MessageBox(DlgMain,"Erreur AddBuffer","RTA",MB_OK);
return 0;
}
}
ResetEvent(recordDone);
if (waveInStart(hWaveIn))
{
waveInClose(hWaveIn);
}
//****
for(i=0; i<NB_BUFFER; i++)
{
pWaveHeaderOut[i] = (PWAVEHDR) malloc(sizeof(WAVEHDR));
}
if (waveOutOpen(&hWaveOut, WAVE_MAPPER, &WaveFormat, (DWORD)waveOutProc, 0L, CALLBACK_FUNCTION))
{
MessageBox(DlgMain,"Ouverture périphérique de sortie impossible","RTA",MB_OK);
return 0;
}
for(i=0; i<NB_BUFFER; i++)
{
pWaveHeaderOut[i]->lpData = (LPSTR) malloc(BUFFER_SIZE); // reserve des octets et non des short
pWaveHeaderOut[i]->dwBufferLength = BUFFER_SIZE;
pWaveHeaderOut[i]->dwBytesRecorded = 0;
pWaveHeaderOut[i]->dwUser = 0;
pWaveHeaderOut[i]->dwFlags = 0;
pWaveHeaderOut[i]->dwLoops = 0;
pWaveHeaderOut[i]->lpNext = NULL;
pWaveHeaderOut[i]->reserved = 0;
}
for(i=0; i<NB_BUFFER; i++)
{
if (waveOutPrepareHeader(hWaveOut, pWaveHeaderOut[i], sizeof(WAVEHDR)))
{
MessageBox(DlgMain,"Erreur PrepareHeader","RTA",MB_OK);
return 0;
}
}
for(i=0; i<NB_BUFFER; i++)
{
if (waveOutWrite(hWaveOut, pWaveHeaderOut[i], sizeof(WAVEHDR)))
{
MessageBox(DlgMain,"Erreur OutWrite","RTA",MB_OK);
return 0;
}
}
ResetEvent(playDone);
//*******
return 0;
}
//****************************************************************************
BOOL CALLBACK DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_INITDIALOG)
{
DlgMain = hWnd;
char str[128];
SendDlgItemMessage(hWnd,IDC_SLIDER_VOLUME,TBM_SETRANGEMAX,0,1000);
SendDlgItemMessage(hWnd,IDC_SLIDER_VOLUME,TBM_SETRANGEMIN,0,0);
SendDlgItemMessage(hWnd,IDC_SLIDER_VOLUME,TBM_SETPOS,1,0); // volume general a fond
volume_general = 1000-SendDlgItemMessage(hWnd,IDC_SLIDER_VOLUME,TBM_GETPOS,0,0);
sprintf(str,"volume: %1.1f dB",20*log10(volume_general/1000));
SetDlgItemText(hWnd,IDC_STATIC_VOLUME,str);
return 0;
}
if (msg == WM_VSCROLL)
{
char str[128];
volume_general = 1000-SendDlgItemMessage(hWnd,IDC_SLIDER_VOLUME,TBM_GETPOS,0,0);
if (volume_general == 0)
{
sprintf(str,"volume: -oo");
SetDlgItemText(hWnd,IDC_STATIC_VOLUME,str);
return 0;
}
sprintf(str,"volume: %1.1f dB", 20*log10(volume_general/1000.0));
SetDlgItemText(hWnd,IDC_STATIC_VOLUME,str);
return 0;
}
if (msg == WM_COMMAND)
{
if (wParam == IDC_START)
{
if(OpenedIn == TRUE)
{
MessageBox(DlgMain,"Déjà ouvert","RTA",MB_OK);
return 0;
}
recordDone = CreateEvent(0, FALSE, FALSE, 0);
ResetEvent(recordDone);
RecordHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) InThreadProc, NULL, 0, &threadidIn);
playDone = CreateEvent(0, FALSE, FALSE, 0);
ResetEvent(playDone);
PlayHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) OutThreadProc, NULL, 0, &threadidOut);
OuvrirPeripheriques();
return 0;
}
if (wParam == IDCANCEL)
{
EndDialog(hWnd, 0);
return 0;
}
}
return 0;
}
//****************************************************************************
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
HANDLE hMutex;
hMutex = CreateMutex (NULL,FALSE, "RTA");
if (GetLastError() == ERROR_ALREADY_EXISTS)
{
MessageBox(NULL,"Cette application est déjà présente en mémoire !","WARNING",MB_OK|MB_ICONEXCLAMATION);
return 0;
}
InitCommonControls();
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1),HWND_DESKTOP,DlgProc);
return 0;
}
//*******************************************************
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
controle du volume audio général [ par roxanic ]
BonjourJe cherche a controler les bouton de volume.Pour le bouton Wave c'est OK. Mais je ne trouve pas le solution pour le curseur du volume général.M
Quelle librairi audio choisir [ par mmaximum ]
Salut à tous,Je cherche à faire un petit moteur de jeu 3D, mais je bloque sur le moteur sonore.Est-ce que quelqu'un connait un petit librairi audio po
Sélectionner la source audio... [ par MisteryX ]
Bonjour à tous,Si j'ai choisi un thème pour poster ma question c'est vraiment parce qu'il le fallait, donc je ne sais pas si j'ai fait le bon choix ??
Capture audio multiple avec directsound [ par CreugenatCoco ]
Bonjour à tous et à toutes, je suis assez nouveau en programmation C++, et je dois réaliser une application qui:- detecte les cartes sons installées e
PIC 16F877 ET PWM [ par faaffou ]
Bonjour, je veux réaliser un programme sur mplab pour générer un signal PWM en utilisant le PIC 16F877 pour faire la variation de vitesse d'un moteur
pilote d'unne carte commande d'un moteur pas à pas [ par slach100 ]
command je peus crier un programme pour l'instalation materielle d'une carte commande d'un moteur pas à pas
Changer le volume d'un WAV par logarithme [ par carat ]
Salut à tous, Je suis en train de développer un lecteur bas-niveau afin de pouvoir intégrer des effets sonores. Je supporte actuellement les pcm, le
converteur audio (wav) en binaire [ par polobou ]
[b]Bonjour[/b][^^happy10] j'ai besoin d'un logiciel qui peut m'aider a converter un "fichier.wav" au code binaire dans un autre "fichier.bin". [b]Merc
Besoin d'aide sur developpement de jeu 3D [ par Niggaz ]
Bonjour, PRÉSENTATION J'ai 27 ans et cela fait déjà un bon moment que je bosse seul sur la partie programmation d'un jeu. Je n'ai pas les compétenc
Séparer les 2 pistes audio d'un fichier mp3 [ par Rogue2575 ]
Bonjour, Quelqu'un saurait il séparer les deux pistes mono d'un fichier mp3 stéréo. Je ne peux pas utiliser audacity car il faudrait que cette séparat
|
Derniers Blogs
UNE JOLIE-HORLOGE ET PAS QU'UN PEU !UNE JOLIE-HORLOGE ET PAS QU'UN PEU ! par neodante
Pour les possesseurs d'iPhone, ça y est Bijin Tokei - qui se traduit littéralement en Français par " Jolie Horloge " - est arrivé et GRATUITEMENT s'il vous plaît ! Après la version Tokyo, Hokkaido, night club, racing, Gal, "pour les mademoiselles'", . voi...
Cliquez pour lire la suite de l'article par neodante TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Forum
RE : WIN APIRE : WIN API par racpp
Cliquez pour lire la suite par racpp WIN APIWIN API par omarino_007
Cliquez pour lire la suite par omarino_007
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|