Accueil > > > PLUGIN ECHO POUR WINAMP
PLUGIN ECHO POUR WINAMP
Information sur la source
Description
Plugin Echo pour Winamp. Permet d'ajouter de l'écho. Une version plus complète bientot. Testé avec Winamp 2.95 Compilé avec Visual C++ 6.0 Compiler et copier ou copier le fichier "dsp_test.dll" dans le répertoire de winamp --> C:\Program Files\Winamp\Plugins\
Source
-
- #include <stdio.h>
- #include <windows.h>
- #include <commctrl.h>
- #include "dsp.h"
- #include "resource.h"
-
- #define NB_ECHO_BUFFERS 10 //
-
- BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
- {
- return TRUE;
- }
-
- HWND echo_control_hwnd;
-
- int quit_echo=0;
-
- winampDSPModule *getModule(int which);
-
- void config(struct winampDSPModule *this_mod);
- int initecho(struct winampDSPModule *this_mod);
- void quitecho(struct winampDSPModule *this_mod);
- int modify_samples1(struct winampDSPModule *this_mod, short int *samples, int numsamples, int bps, int nch, int srate);
-
- static BOOL CALLBACK echoProc (HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
-
- winampDSPHeader hdr = { DSP_HDRVER, "Nullsoft DSP demo v0.3 for Winamp 2", getModule };
-
- int volume_general;
- int gain_echo_L1;
- int gain_echo_R1;
- short echo1_actif = 1;
-
- //****************************************************************************
-
- winampDSPModule mod =
- {
- "echo",
- NULL, // hwndParent
- NULL, // hDllInstance
- config,
- initecho,
- modify_samples1,
- quitecho
- };
-
- //****************************************************************************
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- __declspec( dllexport ) winampDSPHeader *winampDSPGetHeader2()
- {
- return &hdr;
- }
- #ifdef __cplusplus
- }
- #endif
-
- //****************************************************************************
-
- winampDSPModule *getModule(int which)
- {
- switch (which)
- {
- case 0: return &mod;
- default:return NULL;
- }
- }
-
- //****************************************************************************
-
- void config(struct winampDSPModule *this_mod)
- {
- MessageBox(this_mod->hwndParent,"Rock'n'roll :)","Configuration",MB_OK);
- }
-
- //****************************************************************************
-
- // initialisation du module
- int initecho(struct winampDSPModule *this_mod)
- {
- quit_echo=0;
- ShowWindow((echo_control_hwnd=CreateDialog(this_mod->hDllInstance,MAKEINTRESOURCE(IDD_DIALOG1),this_mod->hwndParent,echoProc)),SW_SHOW);
- return 0;
- }
-
- //****************************************************************************
-
- // fonction quit du module
- void quitecho(struct winampDSPModule *this_mod)
- {
- if (this_mod == &mod)
- {
- quit_echo=1;
- if (echo_control_hwnd)
- {
- DestroyWindow(echo_control_hwnd);
- echo_control_hwnd=0;
- }
- }
- }
-
- //****************************************************************************
-
- int modify_samples1(struct winampDSPModule *this_mod, short int *samples, int numsamples, int bps, int nch, int srate)
- {
- static short buffer[NB_ECHO_BUFFERS][4096];
- static int i,j;
-
- if (bps == 16 && nch == 2)
- {
-
- // mettre le bloc entrant dans le dernier bloc du buffer
- for (i = 0; i < numsamples*nch; i+=2)
- {
- buffer[NB_ECHO_BUFFERS-1][i] = samples[i]; // voie gauche
- buffer[NB_ECHO_BUFFERS-1][i+1] = samples[i+1]; // voie droite
- }
-
-
- // calculer l'echo avec le premier bloc et le bloc entrant
- for (i = 0; i < numsamples*nch; i+=2)
- {
- samples[i] = buffer[0][i] * echo1_actif * gain_echo_L1/100 + buffer[NB_ECHO_BUFFERS-1][i]; // voie gauche
- samples[i+1] = buffer[0][i+1] * echo1_actif * gain_echo_R1/100 + buffer[NB_ECHO_BUFFERS-1][i+1]; // voie droite
- }
-
-
- // volume general
- for (i = 0; i < numsamples*nch; i+=2)
- {
- samples[i] = samples[i] * volume_general/100; // voie gauche
- samples[i+1] = samples[i+1] * volume_general/100; // voie droite
- }
-
-
- // memoriser le bloc sortant
- for (i = 0; i < numsamples*nch; i+=2)
- {
- buffer[NB_ECHO_BUFFERS-1][i] = samples[i]; // voie gauche
- buffer[NB_ECHO_BUFFERS-1][i+1] = samples[i+1]; // voie droite
- }
-
-
- // decaler tous les blocs vers la gauche pour laisser la place au prochain bloc entrant
- for (j = 0; j < NB_ECHO_BUFFERS-1; j++)
- {
- for (i = 0; i < numsamples*nch; i+=2)
- {
- buffer[j][i] = buffer[j+1][i]; // voie gauche
- buffer[j][i+1] = buffer[j+1][i+1]; // voie droite
- }
- }
- }
-
- return numsamples;
- }
-
-
- //****************************************************************************
-
- // procedure fenetre echo
- static BOOL CALLBACK echoProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
- {
-
- if (uMsg == WM_DESTROY)
- {
- }
-
- if (uMsg == WM_COMMAND)
- {
- if(wParam == IDC_CHECK1)
- {
- if (IsDlgButtonChecked(hwndDlg , IDC_CHECK1) == BST_UNCHECKED)
- {
- SetDlgItemText(hwndDlg, IDC_CHECK1, "OFF");
- echo1_actif = 0;
- }
- if (IsDlgButtonChecked(hwndDlg , IDC_CHECK1) == BST_CHECKED)
- {
- SetDlgItemText(hwndDlg, IDC_CHECK1, "ON");
- echo1_actif = 1;
- }
- }
- }
-
-
- if (uMsg == WM_INITDIALOG)
- {
- SetWindowPos(hwndDlg, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE); // positionner la fenetre en haut a gauche
-
- CheckDlgButton(hwndDlg, IDC_CHECK1, TRUE); // echo actif au demarrage
- SetDlgItemText(hwndDlg, IDC_CHECK1, "ON");
-
- SendDlgItemMessage(hwndDlg,IDC_SLIDER_VOLUME_GENERAL,TBM_SETRANGEMAX,0,100); // volume general a fond
- SendDlgItemMessage(hwndDlg,IDC_SLIDER_VOLUME_GENERAL,TBM_SETRANGEMIN,0,0);
- SendDlgItemMessage(hwndDlg,IDC_SLIDER_VOLUME_GENERAL,TBM_SETPOS,1,0);
- volume_general = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_VOLUME_GENERAL,TBM_GETPOS,0,0);
- {
- char str[8];
- wsprintf(str,"%d",volume_general);
- SetDlgItemText(hwndDlg,IDC_STATIC_VOLUME_GENERAL,str);
- }
-
- SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINL1,TBM_SETRANGEMAX,0,100);
- SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINL1,TBM_SETRANGEMIN,0,0);
- SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINL1,TBM_SETPOS,1,50);
- gain_echo_L1 = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINL1,TBM_GETPOS,0,0);
- {
- char str[8];
- wsprintf(str,"%d",gain_echo_L1);
- SetDlgItemText(hwndDlg,IDC_STATIC_GAINL1,str);
- }
-
- SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINR1,TBM_SETRANGEMAX,0,100);
- SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINR1,TBM_SETRANGEMIN,0,0);
- SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINR1,TBM_SETPOS,1,50);
- gain_echo_R1 = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINR1,TBM_GETPOS,0,0);
- {
- char str[8];
- wsprintf(str,"%d",gain_echo_R1);
- SetDlgItemText(hwndDlg,IDC_STATIC_GAINR1,str);
- }
- }
-
-
-
-
- if (uMsg == WM_VSCROLL)
- {
- volume_general = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_VOLUME_GENERAL,TBM_GETPOS,0,0);
- {
- char str[8];
- wsprintf(str,"%d",volume_general);
- SetDlgItemText(hwndDlg,IDC_STATIC_VOLUME_GENERAL,str);
- }
- gain_echo_L1 = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINL1,TBM_GETPOS,0,0);
- {
- char str[8];
- wsprintf(str,"%d",gain_echo_L1);
- SetDlgItemText(hwndDlg,IDC_STATIC_GAINL1,str);
- }
- gain_echo_R1 = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINR1,TBM_GETPOS,0,0);
- {
- char str[8];
- wsprintf(str,"%d",gain_echo_R1);
- SetDlgItemText(hwndDlg,IDC_STATIC_GAINR1,str);
- }
- }
-
-
-
-
-
- return 0;
- }
-
- //****************************************************************************
#include <stdio.h>
#include <windows.h>
#include <commctrl.h>
#include "dsp.h"
#include "resource.h"
#define NB_ECHO_BUFFERS 10 //
BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
{
return TRUE;
}
HWND echo_control_hwnd;
int quit_echo=0;
winampDSPModule *getModule(int which);
void config(struct winampDSPModule *this_mod);
int initecho(struct winampDSPModule *this_mod);
void quitecho(struct winampDSPModule *this_mod);
int modify_samples1(struct winampDSPModule *this_mod, short int *samples, int numsamples, int bps, int nch, int srate);
static BOOL CALLBACK echoProc (HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
winampDSPHeader hdr = { DSP_HDRVER, "Nullsoft DSP demo v0.3 for Winamp 2", getModule };
int volume_general;
int gain_echo_L1;
int gain_echo_R1;
short echo1_actif = 1;
//****************************************************************************
winampDSPModule mod =
{
"echo",
NULL, // hwndParent
NULL, // hDllInstance
config,
initecho,
modify_samples1,
quitecho
};
//****************************************************************************
#ifdef __cplusplus
extern "C" {
#endif
__declspec( dllexport ) winampDSPHeader *winampDSPGetHeader2()
{
return &hdr;
}
#ifdef __cplusplus
}
#endif
//****************************************************************************
winampDSPModule *getModule(int which)
{
switch (which)
{
case 0: return &mod;
default:return NULL;
}
}
//****************************************************************************
void config(struct winampDSPModule *this_mod)
{
MessageBox(this_mod->hwndParent,"Rock'n'roll :)","Configuration",MB_OK);
}
//****************************************************************************
// initialisation du module
int initecho(struct winampDSPModule *this_mod)
{
quit_echo=0;
ShowWindow((echo_control_hwnd=CreateDialog(this_mod->hDllInstance,MAKEINTRESOURCE(IDD_DIALOG1),this_mod->hwndParent,echoProc)),SW_SHOW);
return 0;
}
//****************************************************************************
// fonction quit du module
void quitecho(struct winampDSPModule *this_mod)
{
if (this_mod == &mod)
{
quit_echo=1;
if (echo_control_hwnd)
{
DestroyWindow(echo_control_hwnd);
echo_control_hwnd=0;
}
}
}
//****************************************************************************
int modify_samples1(struct winampDSPModule *this_mod, short int *samples, int numsamples, int bps, int nch, int srate)
{
static short buffer[NB_ECHO_BUFFERS][4096];
static int i,j;
if (bps == 16 && nch == 2)
{
// mettre le bloc entrant dans le dernier bloc du buffer
for (i = 0; i < numsamples*nch; i+=2)
{
buffer[NB_ECHO_BUFFERS-1][i] = samples[i]; // voie gauche
buffer[NB_ECHO_BUFFERS-1][i+1] = samples[i+1]; // voie droite
}
// calculer l'echo avec le premier bloc et le bloc entrant
for (i = 0; i < numsamples*nch; i+=2)
{
samples[i] = buffer[0][i] * echo1_actif * gain_echo_L1/100 + buffer[NB_ECHO_BUFFERS-1][i]; // voie gauche
samples[i+1] = buffer[0][i+1] * echo1_actif * gain_echo_R1/100 + buffer[NB_ECHO_BUFFERS-1][i+1]; // voie droite
}
// volume general
for (i = 0; i < numsamples*nch; i+=2)
{
samples[i] = samples[i] * volume_general/100; // voie gauche
samples[i+1] = samples[i+1] * volume_general/100; // voie droite
}
// memoriser le bloc sortant
for (i = 0; i < numsamples*nch; i+=2)
{
buffer[NB_ECHO_BUFFERS-1][i] = samples[i]; // voie gauche
buffer[NB_ECHO_BUFFERS-1][i+1] = samples[i+1]; // voie droite
}
// decaler tous les blocs vers la gauche pour laisser la place au prochain bloc entrant
for (j = 0; j < NB_ECHO_BUFFERS-1; j++)
{
for (i = 0; i < numsamples*nch; i+=2)
{
buffer[j][i] = buffer[j+1][i]; // voie gauche
buffer[j][i+1] = buffer[j+1][i+1]; // voie droite
}
}
}
return numsamples;
}
//****************************************************************************
// procedure fenetre echo
static BOOL CALLBACK echoProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_DESTROY)
{
}
if (uMsg == WM_COMMAND)
{
if(wParam == IDC_CHECK1)
{
if (IsDlgButtonChecked(hwndDlg , IDC_CHECK1) == BST_UNCHECKED)
{
SetDlgItemText(hwndDlg, IDC_CHECK1, "OFF");
echo1_actif = 0;
}
if (IsDlgButtonChecked(hwndDlg , IDC_CHECK1) == BST_CHECKED)
{
SetDlgItemText(hwndDlg, IDC_CHECK1, "ON");
echo1_actif = 1;
}
}
}
if (uMsg == WM_INITDIALOG)
{
SetWindowPos(hwndDlg, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE); // positionner la fenetre en haut a gauche
CheckDlgButton(hwndDlg, IDC_CHECK1, TRUE); // echo actif au demarrage
SetDlgItemText(hwndDlg, IDC_CHECK1, "ON");
SendDlgItemMessage(hwndDlg,IDC_SLIDER_VOLUME_GENERAL,TBM_SETRANGEMAX,0,100); // volume general a fond
SendDlgItemMessage(hwndDlg,IDC_SLIDER_VOLUME_GENERAL,TBM_SETRANGEMIN,0,0);
SendDlgItemMessage(hwndDlg,IDC_SLIDER_VOLUME_GENERAL,TBM_SETPOS,1,0);
volume_general = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_VOLUME_GENERAL,TBM_GETPOS,0,0);
{
char str[8];
wsprintf(str,"%d",volume_general);
SetDlgItemText(hwndDlg,IDC_STATIC_VOLUME_GENERAL,str);
}
SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINL1,TBM_SETRANGEMAX,0,100);
SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINL1,TBM_SETRANGEMIN,0,0);
SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINL1,TBM_SETPOS,1,50);
gain_echo_L1 = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINL1,TBM_GETPOS,0,0);
{
char str[8];
wsprintf(str,"%d",gain_echo_L1);
SetDlgItemText(hwndDlg,IDC_STATIC_GAINL1,str);
}
SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINR1,TBM_SETRANGEMAX,0,100);
SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINR1,TBM_SETRANGEMIN,0,0);
SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINR1,TBM_SETPOS,1,50);
gain_echo_R1 = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINR1,TBM_GETPOS,0,0);
{
char str[8];
wsprintf(str,"%d",gain_echo_R1);
SetDlgItemText(hwndDlg,IDC_STATIC_GAINR1,str);
}
}
if (uMsg == WM_VSCROLL)
{
volume_general = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_VOLUME_GENERAL,TBM_GETPOS,0,0);
{
char str[8];
wsprintf(str,"%d",volume_general);
SetDlgItemText(hwndDlg,IDC_STATIC_VOLUME_GENERAL,str);
}
gain_echo_L1 = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINL1,TBM_GETPOS,0,0);
{
char str[8];
wsprintf(str,"%d",gain_echo_L1);
SetDlgItemText(hwndDlg,IDC_STATIC_GAINL1,str);
}
gain_echo_R1 = 100-SendDlgItemMessage(hwndDlg,IDC_SLIDER_GAINR1,TBM_GETPOS,0,0);
{
char str[8];
wsprintf(str,"%d",gain_echo_R1);
SetDlgItemText(hwndDlg,IDC_STATIC_GAINR1,str);
}
}
return 0;
}
//****************************************************************************
Historique
- 22 janvier 2007 20:23:05 :
-
1: correction des erreurs de pointage du buffer
2: ajout d'un check de coupure directe de l'echo
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Gestion du déplacement à la Winamp ! [ par Manson ]
'lut,j'aimerais implémenter dans mon prog, fais en Visual C, le meme principe que Winamp pour déplacer les fenetres. En fait dans Winamp pour déplacer
Controle Winamp... [ par erasor ]
Salu je suis total n00b et je voudrai savoir comment controler winamp en c++,j'ai suivi le tutorial de winamp.com mais je n'abouti a rien alors si que
Controle Winamp... [ par erasor ]
Salu je suis total n00b et je voudrai savoir comment controler winamp en c++,j'ai suivi le tutorial de winamp.com mais je n'abouti a rien alors si que
Commande Winamp 3 [ par Mirada2000 ]
Je voudrais créer 4 executable afin de donenr 4 action distinctes a winamp 3 :- Play/Pause- Stop- SUivant- Précédentcela avait deja été fait pour wina
Winamp [ par MaitreDragon ]
Bonjour,Je voudrais pouvoir controler winamp par programmation (lecture, pause, stop,volume,...) sous borland c++ builder 5.Quelqu'un saurait-il comme
winamp path [ par BombStrike ]
Comment récuperer le path de winamp dans la base de registre ? Merci :)je sais juste que c'est stocké dans HKEY_CURRENT_USER\Software\Winamp\\(Défaut)
Comment avoir une icone ou une btimap d'un fichier? [ par JackosKing ]
Voilà, je voulais savoir si l'on pouvais simplement avoir l'icone ou une bitmap d'un fichier.. par exemple celle d'un exe ou alors d'un .mp3 (l'icone
Programme fonctionnant en arriere plan [ par bdkiller ]
Bonjour, je cherche a faire un programme qui va fonctionner en arriere plan, cad je crée un controlleur de winamp, et j'utilise ceci comme code: (je s
[HOOK]Encore le meme probleme.. [ par bdkiller ]
Salut,Bon, après pas mal d'heures passés là-dessus, j'ai la DLL qui se compile sans erreurs, l'appli principale qui se compile sans erreurs également!
Plugins Winamp ! [ par PaTaTe ]
Bonjour,Je suis (très très) débutant en C/C++, je préfère Visual Basic (non pas la tête).Je cherche un moyen de faire un OCX (en C) permettant de gére
|
Derniers Blogs
IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc REACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITERREACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITER par Groc
Une mauvaise utilisation de rx lors de l'écriture d'une couche d'accès à des services peut conduire à des cas embarassants avec des erreurs mal gérées, des appels qui ne partent lorsqu'ils le devraient, et même des résultats incorrects . le tout nuis...
Cliquez pour lire la suite de l'article par Groc SHAREPOINT BLOG SITE, PROBLèME D'ARCHIVESSHAREPOINT BLOG SITE, PROBLèME D'ARCHIVES par junarnoalg
Dernièrement, nous avons migré le site
myTIC
vers un nouveau serveur SharePoint 2010. Dans les contenus que nous vouloins récupérer, nous avions un certain nombre de blogs.
Nous avons utilisé les commandes Power...
Cliquez pour lire la suite de l'article par junarnoalg
Forum
MATRICE TEMPLATEMATRICE TEMPLATE par hjr2610
Cliquez pour lire la suite par hjr2610 RE : SAC A DOS RE : SAC A DOS par hadjkaddour
Cliquez pour lire la suite par hadjkaddour
Logiciels
sDEVIS-FACTURES vlPRO (8.1.0.3)SDEVIS-FACTURES VLPRO (8.1.0.3)sDEVIS-FACTURES vlPRO a été mis au point pour les particuliers, créateurs, entrepreneurs, artisa... Cliquez pour télécharger sDEVIS-FACTURES vlPRO 974 Application Server (12.2.4.6)974 APPLICATION SERVER (12.2.4.6)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP
|