TagsMp3+FMOD+wxWIDGETS

Résolu
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 - 31 juil. 2005 à 17:27
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 - 6 août 2005 à 04:28
salut, je voudrai récuperer les tags des fichiers audio avec FMOD et wxWIDGETS .Pourriez vous me donner la méthode pour faire ca car je comprens pas biencomment ca s'passe

merci bien a tous
++

4 réponses

cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 1
6 août 2005 à 04:28
voici le code qui a priori , n'a pas de bugg, et récupere les tags dans une fenetre a part :

/*//////////////////////////////////////////////////////////////////////////////////////////////////////////
*Clik sur infos dans le menu
*///////////////////////////////////////////////////////////////////////////////////////////////////////////
//création des éléments graphiques de la fenetre infosDlg...
void Mp3PlayerFrm::MenuInfos(wxCommandEvent& event)
{
if(!stream){return;}
if(infosDlg){infosDlg->Show(false);}
infosDlg = new wxDialog(this, -1, "infos tags", wxPoint(0,0), wxSize(-1,320), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER,"dialogBox");
info1 = new wxStaticText (infosDlg, -1, "", wxPoint(10,10), wxSize(-1, -1), 0, "staticText");
info2 = new wxStaticText (infosDlg, -1, "", wxPoint(10,50), wxSize(-1, -1), 0, "staticText");
info3 = new wxStaticText (infosDlg, -1, "", wxPoint(10,90), wxSize(-1, -1), 0, "staticText");
info4 = new wxStaticText (infosDlg, -1, "", wxPoint(10,130), wxSize(-1, -1), 0, "staticText");
info5 = new wxStaticText (infosDlg, -1, "", wxPoint(10,170), wxSize(-1, -1), 0, "staticText");
info6 = new wxStaticText (infosDlg, -1, "", wxPoint(10,210), wxSize(-1, -1), 0, "staticText");
ligne1 = new wxStaticLine(infosDlg, -1, wxPoint(0,250), wxSize(2048, -1), wxLI_HORIZONTAL, "staticLine");
infosDlg->Show(true);
infos();
}
//balance les infos dans la fentre...
void Mp3PlayerFrm::infos()
{
if(!stream){return;}


int num;
int type;
char *name;
void *value;
int length;
char *InfoMedia;
InfoMedia = new char[1024];
char *emplacement;
emplacement = new char[1024];
wxString msg;


sprintf(emplacement, "DIRECTORY : %s", chemin);
info1->SetLabel(emplacement);


if (!FSOUND_Stream_GetNumTagFields(stream, &num)){return;}


if (num==0){return;}


for (int i = 0; i < num; i++)
{
FSOUND_Stream_GetTagField(stream,i,&type,&name,&value,&length);
sprintf(InfoMedia, "%s : %s", name, value);

if (!strncmp(name, "TITLE", 5))
info3->SetLabel(InfoMedia);

if (!strncmp(name, "ARTIST", 6))
info2->SetLabel(InfoMedia);

if (!strncmp(name, "ALBUM", 5))
info4->SetLabel(InfoMedia);

if (!strncmp(name, "YEAR", 4))
info5->SetLabel(InfoMedia);

if(!strncmp(name, "COMMENT", 7))
info6->SetLabel(InfoMedia);
}
}

think community++!
tekno, tekno
3
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 1
2 août 2005 à 22:00
personne pour les tags???
j' ai essayer d' utiliser la classe id3v d' un mister sur le site mais impossible d'inclure son .h qui est fait pour du win 32

Explikez moi comment récuperer les tags avec
FSOUND_Stream_GetTagField(
FSOUND_STREAM *stream,
int num,
int *type,
char **name,
void **value,
int *length
);
SVP !!!!!!!!
je rame et je suis sur que c'est un tit truk a la con!

allé ++ et thx
0
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 1
4 août 2005 à 02:44
Bon, vu que personne veut m' aider j' agrémente un peu :
voila mon code actuel:

/*//////////////////////////////////////////////////////////////////////////////////////////////////////////
*Clik sur infos dans le menu
*///////////////////////////////////////////////////////////////////////////////////////////////////////////
//création des éléments graphiques de la fenetre infosDlg...
void Mp3PlayerFrm::MenuInfos(wxCommandEvent& event)
{
if(!stream){return;}
infosDlg = new wxDialog(this, -1, "infos tags", wxPoint(0,0), wxSize(300,310), wxDEFAULT_DIALOG_STYLE ,"dialogBox");
info1 = new wxStaticText (infosDlg, -1, "Emplacement :", wxPoint(10,10), wxDefaultSize, 0, "staticText");
info2 = new wxStaticText (infosDlg, -1, "Titre :", wxPoint(10,50), wxDefaultSize, 0, "staticText");
info3 = new wxStaticText (infosDlg, -1, "Artiste :", wxPoint(10,90), wxDefaultSize, 0, "staticText");
info4 = new wxStaticText (infosDlg, -1, "Durée :", wxPoint(10,130), wxDefaultSize, 0, "staticText");
info5 = new wxStaticText (infosDlg, -1, "Date :", wxPoint(10,170), wxDefaultSize, 0, "staticText");
info6 = new wxStaticText (infosDlg, -1, "Commentaires :", wxPoint(10,210), wxDefaultSize, 0, "staticText");
ligne1 = new wxStaticLine(infosDlg, -1, wxPoint(10,250), wxSize(280, -1), wxLI_HORIZONTAL, "staticLine");
infosDlg->Show(true);
infos();
}


void Mp3PlayerFrm::infos()
{
if(!stream){return;}
int num;
int type;
char *name;
void *value;
int length;


if (!FSOUND_Stream_GetNumTagFields(stream, &num)){return;}
if (num==0){return;}


for (int i = 0; i < num; i++){
FSOUND_Stream_GetTagField(stream,i,&type,&name,&value,&length);


// et c'est la que le bas blaisse!!!!!
}
}

en fait, j' arrive a récupérer le tag , j'ai fait des tests avec des messages box et j' ai bien toutes les infos dans value.Donc mon probleme c'est savoir comment dissocier titre , année, artiste etc... et tout ca avec wx.
j'ai reluqué qques exemples de cppcs mais je dois dire que je ne comprends pas.
par ex :

// Titre
if( !strcmp(Nom_Champ,"TITLE") )
strncpy( Infos.Titre, (char*)Val_Champ, len );
// Album
else if( !strcmp(Nom_Champ,"ALBUM") )
strncpy( Infos.Album, (char*)Val_Champ, len );

etc....
d' ou sort "TITLE"??
if( !strcmp.... -> comprends pas ca.

voila donc avec ces précisions va bien y avoir qqun qui va pouvoir me donner un coup de main j' espere.

merci bien
++

tekno, tekno
0
cs_satellite34 Messages postés 688 Date d'inscription mercredi 6 avril 2005 Statut Membre Dernière intervention 2 juin 2006 1
4 août 2005 à 04:04
ben du coup je suis allé faire un tit tour ds le manuel de référence cpp et j' ai réussi !
pour ceux que ca interresse :

/*//////////////////////////////////////////////////////////////////////////////////////////////////////////
*Clik sur infos dans le menu
*///////////////////////////////////////////////////////////////////////////////////////////////////////////
//création des éléments graphiques de la fenetre infosDlg...
void Mp3PlayerFrm::MenuInfos(wxCommandEvent& event)
{
if(!stream){return;}
infosDlg = new wxDialog(this, -1, "infos tags", wxPoint(0,0), wxSize(300,310), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER,"dialogBox");
info1 = new wxStaticText (infosDlg, -1, "", wxPoint(10,10), wxDefaultSize, 0, "staticText");
info2 = new wxStaticText (infosDlg, -1, "", wxPoint(10,50), wxDefaultSize, 0, "staticText");
info3 = new wxStaticText (infosDlg, -1, "", wxPoint(10,90), wxDefaultSize, 0, "staticText");
info4 = new wxStaticText (infosDlg, -1, "", wxPoint(10,130), wxDefaultSize, 0, "staticText");
info5 = new wxStaticText (infosDlg, -1, "", wxPoint(10,170), wxDefaultSize, 0, "staticText");
info6 = new wxStaticText (infosDlg, -1, "", wxPoint(10,210), wxDefaultSize, 0, "staticText");
ligne1 = new wxStaticLine(infosDlg, -1, wxPoint(10,250), wxSize(280, -1), wxLI_HORIZONTAL, "staticLine");
infosDlg->Show(true);
infos();
}


void Mp3PlayerFrm::infos()
{
if(!stream){return;}


int num;
int type;
char *name;
void *value;
int length;
char *InfoMedia;
InfoMedia = new char[2500];
wxString msg;


info1->SetLabel(chemin);



if (!FSOUND_Stream_GetNumTagFields(stream, &num)){return;}
if (num==0){return;}


for (int i = 0; i < num; i++)
{
FSOUND_Stream_GetTagField(stream,i,&type,&name,&value,&length);
sprintf(InfoMedia,"%s",value);

if (!strncmp(name, "TITLE", 5))
info2->SetLabel(InfoMedia);

if (!strncmp(name, "ARTIST", 6))
info3->SetLabel(InfoMedia);

if (!strncmp(name, "ALBUM", 5))
info4->SetLabel(InfoMedia);

if (!strncmp(name, "YEAR", 4))
info5->SetLabel(InfoMedia);

if(!strncmp(name, "COMMENT", 7))
info6->SetLabel(InfoMedia);
}
}
bon, c'est évidemment pas fini mais cela récupêre les tags en bon et du forme ds une dialog box

tekno, tekno
0
Rejoignez-nous