DB3210 - Drawing on player possible - developers needed : Эльфостроение : Форум

Страница 2 из 3: « 1 [2] 3 »

 IronMaster:
20.07.10, 09:16
 mc_kibel писал:
typedef struct
{
wchar_t *fname;
wchar_t *fpath;
char *MIME;
wchar_t *extension;
}BOOK_PLAYER_TRACK_DESC_3210;


maybe it's FILEITEM structure?

 KrasH:
20.07.10, 11:51
 Итак,нормальная структура в студию:

Код: 
typedef void* PMusicServer;

typedef struct
{
  int hour;
  int min;
  int sec;
}TIME_int;

typedef struct
{
  BOOK book;
  PMusicServer pIMusicServer;
  char dummy_0x0[0x4];
  GUI * Music_Gui_PlayQueue;
  char dummy_0x1[0x16];
  wchar_t current_track_id;
  wchar_t tracks_count;
  char dummy[0x6];
  TIME_int ElapsedTime;
  char dummy_0x2[0x4];
  SUB_EXECUTE *CurrentTrack_SUB_EXECUTE;
  char dummy_0x3[0x4C];
}MUSIC_APPLICATION_BOOK;

class IUnknown
{
public:
  virtual void* pguid(); //GUID
  virtual void* QueryInterface();
  virtual void* AddRef();
  virtual void* Release();
};  

class CMusicServer : public IUnknown
{
public:
  virtual void* unk_0x10();
  virtual void* unk_0x14();
  virtual void* unk_0x18();
  virtual void* unk_0x1C();
  virtual void* unk_0x20();
  virtual void* unk_0x24();
  virtual void* unk_0x28();
  virtual void* unk_0x2C();
  virtual void* unk_0x30();
  virtual int GetTrackFullpath(wchar_t track_id,int bufsize,wchar_t *buf);
  virtual void* unk_0x38();
  virtual void* unk_0x3C();
  virtual void* unk_0x40();
  virtual void* unk_0x44();
  virtual void* unk_0x48();
  virtual void* unk_0x4C();
  virtual void* unk_0x50();
  virtual void* unk_0x54();
  virtual void* unk_0x58();
  virtual void* unk_0x5C();
  virtual void* unk_0x60();
  virtual void* unk_0x64();
  virtual void* unk_0x68();
  virtual void* unk_0x6C();
  virtual void* unk_0x70();
  virtual int EqualizerGain_Set(int band,int level);
};


Ну и функция для получения пути/имени файла:

Код: 
int MusicApplication_GetCurrentTrackPN(BOOK * MusicApplicationBook,wchar_t *fpath,wchar_t *fname)
{
  int retcode = _NULL;
  wchar_t *fullpath = new wchar_t[0x101];
  if (!MusicApplicationBook || !((MUSIC_APPLICATION_BOOK*)MusicApplicationBook)->pIMusicServer) return retcode;
  if (((CMusicServer*)((MUSIC_APPLICATION_BOOK*)MusicApplicationBook)->pIMusicServer)->GetTrackFullpath(((MUSIC_APPLICATION_BOOK*)MusicApplicationBook)->current_track_id,0x200,fullpath)>=0) retcode = 1;
  else return retcode;
  wchar_t * pos = wstrrchr(fullpath,'/');
  *pos = _NULL;
  wstrcpy(fpath,fullpath);
  wstrcpy(fname,pos+1);
  delete fullpath;
  return retcode;
};


Ну и код простенького эльфа,использующего эту функцию =)

Код: 
int main()
{
  wchar_t path[255],name[255],info[255];
  BOOK * MusicApplicationBook = FindBook(isAudioPlayerBook());
  if (MusicApplicationBook)
  {
    if (MusicApplication_GetCurrentTrackPN(MusicApplicationBook,path,name))
    {
      snwprintf(info,255,L"Current Track\nPath: %ls\nName: %ls",path,name);
      MessageBox(EMPTY_SID,Str2ID(info,0,SID_ANY_LEN),NOIMAGE,1,0,0);
    }
  }
  return 0;
};


Скрин эльфа (спасибо Oganyan-Arthur):
http://upwap.ru/957551

 IronMaster:
20.07.10, 15:05
 mc_kibel писал:
Functions in LibraryDLL for getting mp3 tags are so slow :( Animation is about 5-7 fps...


i specially tested this functions.
Код: 

  int start_time = get_system_ticks();
  void * MetaData_Desc = MetaData_Desc_Create(L"/usb/music",L"music.mp3");
  wchar_t * artist = MetaData_Desc_GetTags(MetaData_Desc,0);
  wchar_t * title = MetaData_Desc_GetTags(MetaData_Desc,1);
  wchar_t * album = MetaData_Desc_GetTags(MetaData_Desc,2);
  wchar_t * year = MetaData_Desc_GetTags(MetaData_Desc,3);
  wchar_t * genre = MetaData_Desc_GetTags(MetaData_Desc,4);
  int track = MetaData_Desc_GetTrackNum(MetaData_Desc,0);
  MetaData_Desc_Destroy(MetaData_Desc);


it takes about 2-4 ms. And about 80% of this time takes "MetaData_Desc_Create".
it's too slow???

Plus this functions can get tags from many media formats, not only mp3

 mc_kibel:
20.07.10, 17:09
 
IronMaster пишет:
mc_kibel писал:
Functions in LibraryDLL for getting mp3 tags are so slow :( Animation is about 5-7 fps...


i specially tested this functions.
Код: 

  int start_time = get_system_ticks();
  void * MetaData_Desc = MetaData_Desc_Create(L"/usb/music",L"music.mp3");
  wchar_t * artist = MetaData_Desc_GetTags(MetaData_Desc,0);
  wchar_t * title = MetaData_Desc_GetTags(MetaData_Desc,1);
  wchar_t * album = MetaData_Desc_GetTags(MetaData_Desc,2);
  wchar_t * year = MetaData_Desc_GetTags(MetaData_Desc,3);
  wchar_t * genre = MetaData_Desc_GetTags(MetaData_Desc,4);
  int track = MetaData_Desc_GetTrackNum(MetaData_Desc,0);
  MetaData_Desc_Destroy(MetaData_Desc);


it takes about 2-4 ms. And about 80% of this time takes "MetaData_Desc_Create".
it's too slow???

Plus this functions can get tags from many media formats, not only mp3


Sorry, something different is a problem, not this functions :-) - animation is really fast with only one GC_PutChar and without DrawStrings. I will take a look at this little bit deeper.

IronMaster пишет:
mc_kibel писал:
typedef struct
{
wchar_t *fname;
wchar_t *fpath;
char *MIME;
wchar_t *extension;
}BOOK_PLAYER_TRACK_DESC_3210;


maybe it's FILEITEM structure?


I'm not sure:

Код: 
typedef struct
{
  wchar_t * __fname;
  wchar_t * __path; 
  char *MIME_type;
  wchar_t * extension;
  int * FSTAT;
  int * DRMHandle;
  char DRM_Flag;
}FILEITEM;


int * FSTAT seems to be ok, but under this, there's int * DRMHandle, it's a pointer and it should be 0x50......, but in dump it is zero:
Код: 

typedef struct
{
  wchar_t *fname;
  wchar_t *fpath;
  char *MIME;
  wchar_t *extension;
  int * FSTAT; // ??
  int zero; // <<------------ ?
}BOOK_PLAYER_TRACK_DESC_3210;



KrasH - Good job :-D Thanks :-)

 MO_oC:
02.10.10, 10:31
 virtual void* unk_0x2C(); -> virtual int GetTags(int track_id,int bufsize,wchar_t* artist,wchar_t* album,wchar_t* title);
virtual void* unk_0x30(); -> virtual int GetFullInfo(int track_id,int bufsize,wchar_t* artist,wchar_t* album,wchar_t* title,wchar_t* filename,TIME_int* fulltime,TIME_int* curtime,char* unk1,char* unk2);

[ Редактировано MO_oC в 3.10.10 15:41 ]

 blacklizard:
18.10.10, 16:19
 
Код: 
class CMusicServer : public IUnknown
{
public:
  virtual void* unk_0x10();
  virtual void* unk_0x14();
  virtual void* unk_0x18();
  virtual void* unk_0x1C();
  virtual void* unk_0x20();
  virtual void* unk_0x24();
  virtual void* unk_0x28();
  virtual int GetTags(int track_id,int bufsize,wchar_t* artist,wchar_t* album,wchar_t* title);
  virtual int GetFullInfo(int track_id,int bufsize,wchar_t* artist,wchar_t* album,wchar_t* title,wchar_t* filename,TIME_int* fulltime,TIME_int* ResumePosition,TBool* HaveAlbumArt,TBool* IsRealMediaFile);
  virtual int GetTrackFullpath(wchar_t track_id,int bufsize,wchar_t *buf);
  virtual int GetAlbumArt(int track_id,int bufsize,wchar_t* filename,int* Offset,int* Size,int* Type/*1=Jpeg,2=Gif,3=Png,4=Bmp,5=None,6=Embedded*/,TBool* IsDRMProtected);
  virtual int GetState(char* State);
  virtual int Play(int track_id);
  virtual int Pause(void);
  virtual int FastFoward(void);
  virtual int Rewind(void);
  virtual void* unk_0x50();
  virtual int Previous(void);
  virtual int SetElapsedTime(TIME time);
  virtual int GetElapsedTime(TIME* time);
  virtual int SetWindowMode(char mode);
  virtual int SetStarted(TBool started);
  virtual int SetStereoWidening(TBool enable);
  virtual int EnableEqualizer(void);
  virtual int DisableEqualizer(void);
  virtual int EqualizerGain_Set(int band,int level);
};


 MO_oC:
23.10.10, 21:35
 blacklizard,

Код: 

class IShell: public IUnknown
{
public:
  virtual int method0();
  virtual int method1();
  virtual int method2();
  virtual int method3();
  virtual int IShell_CreateInstance(PUUID cid, PUUID iid, void** pInterface);
};

UUID CID_byte_15A15484={0x9, 0xE5, 0x76, 0x91, 0x7F, 0x36, 0x4B, 0x59, 0x82,0xB9, 0x89, 0x19, 0xEA, 0x18, 0xB6, 0xF8};
UUID IID_byte_15A55040={0xAE, 0x67, 0x65, 0x71, 0xB3, 0x99, 0x44, 0xBE, 0xA5,0xF4, 0xE6, 0x96, 0xCA, 0x63, 0x18, 0x6B};

class ISomeThing: public IUnknown
{
public:
  virtual int method0(void * ,void ** );
  virtual int method1();
};

  IShell * pIShell = NULL;
  ISomeThing * pISomeThing = NULL;
  IMusicServer * pIMusicServer = NULL;
  OSE_GetShell(PPINTERFACE(&pIShell));
  if(pIShell)
  {
    pIShell->IShell_CreateInstance(&CID_byte_15A15484,&IID_byte_15A55040,PPINTERFACE(&pISomeThing));
    if(pISomeThing)
    {
      
      pISomeThing->method0(pIShell,PPINTERFACE(&pIMusicServer));
      if(pIMusicServer)
      {
        wchar_t filename[128];
        pIMusicServer->GetTrackFullpath(1,128,filename);
        MessageBox(EMPTY_SID,Str2ID(filename,0,0xFFFF),NOIMAGE,1,NULL,NULL);
        pIMusicServer->Release();
      }
      pISomeThing->Release();
    }
    pIShell->Release();
  }



this class only work with the music going, so I think it is better to get its pointer by audiobook.

[ Редактировано MO_oC в 24.10.10 02:44 ]

 blacklizard:
23.10.10, 21:55
 MO_oC, thanks for the code.

0x15A15484 is for what FW? And how did you managed to find this offset? Thanks in advance

 den_po:
23.10.10, 23:20
 blacklizard, man, this is just a varname. the code above contains UUID you need


Добавлено 23.10.10 23:24

MO_oC, as far as i understand your ISomeThing is IMusicServer_Manager

 MO_oC:
24.10.10, 05:14
 blacklizard, I get the offset from LR, then reseach it.
Страница 2 из 3: « 1 [2] 3 »

URL этой темы:
https://mobilefree.justdanpo.ru/newbb_plus/viewtopic.php?topic_id=4938&start=10

© 2005-2018 supertrubka.org