Создание Эльфов : Эльфостроение : Форум

Страница 164 из 211: « 1 ... 160 161 162 163 [164] 165 166 167 168 ... 211 »

 blacklizard:
11.02.11, 02:00
 zylka, no restart in my w995

 zylka:
11.02.11, 02:08
 On my W800 is to restart
and Boysie said that k800 also.

file as an attachment
taken from sources logbooks.zip

Прикрепленный к сообщению файл:

booklog.elf booklog.elf (2.64 kb; 5 hits) Скачать файл

 den_po:
11.02.11, 05:32
 
blacklizard пишет:
den_po, you mean by decoding UTF-8 string, we can use special characters? I don't get it.
I read here but dont get it
http://en.wikipedia.org/wiki/UTF-8

utf8 allows to store unicode characters as a sequence of 8bit characters. for example there is no another correct way to store any texts including cyrillic/chinese/arabic/etc characters into INI files (see manifest_GetParam function).
unicode2win1251/win12512unicode/etc is a very bad way.

blacklizard пишет:
By the way, can you please add this constant to SVN?

UI_MEDIAPLAYER_NEW_TRACK_EVENT

why don't you use callbacks?


zylka пишет:
den_po, logbooks will reset at the entrance to contacts.
My new elf based on ModifyUIPageHook (PAGE_ENTER_EVENT...
also

What is the cause?

i've checked it.
PB_UI_LockHandler_CheckServerLock_Page of PB_UI_LockHandlerBook kills the book, so after calling original event handler our "UIPageHook_After" gets invalid book pointer.

"after" hooks must check if the book pointer is valid before using it
Код: 

int FindBookExCB_Book( BOOK* book , int* param )
{
    return book == (BOOK*)param;
}

...

    if( ! FindBookEx( FindBookExCB_Book, (int*) book ) )
        return 0;

if you don't use the book pointer in your UIPageHook_After but you want to know book name you may use both UIPageHook_Before and UIPageHook_After hooks (don't use the same callback for both hooks). keep in mind a reenterability. it's better to store pointers and associated data into arrays/lists.


fixed version. new example also illustrates how to use STL

Прикрепленный к сообщению файл:

logbooks2.zip logbooks2.zip (5.17 kb; 24 hits) Скачать файл

 blacklizard:
12.02.11, 00:56
 
den_po пишет:
why don't you use callbacks?


I need the track's total time.

This method return the correct data when MusicApplication Book is focused. If called from standby, i returns (trackid-1)data when changing track from standby

Код:
GetFullInfo(int track_id, int bufsize, wchar_t* artist, wchar_t* album, wchar_t* title, wchar_t* filename,TMusicServer_Time* Fulltime,TMusicServer_Time* ElapsedTime,bool* HaveAlbumArt,bool* IsRealMediaFile);


Thats why i din use callback :)

Hope you can add it :)

[ Редактировано blacklizard в 12.2.11 05:57 ]


Добавлено 12.2.11 06:18

when i draw on player, it returns the correct data

 den_po:
12.02.11, 01:20
 blacklizard, ты что-то путаешь. используй ICBMusicServer

 blacklizard:
12.02.11, 01:31
 den_po, you mean this method fromICBMusicServer?
Код:
OnItemChanged(void statusCode,FUint32 itemIndex,TMusicServer_Time resumePosition,TMusicServer_Action currentPlayerAction,TChar* pURI,FUint32 lengthOfURI,TChar* pTitle,FUint32 lengthOfTitle,TChar* pArtist,FUint32 lengthOfArtist,TChar* pAlbum,FUint32 lengthOfAlbum,TMusicServer_Time playLength,bool containsAlbumart,bool isDRMProtected,bool isRealMediaFile,int clientData); //Notifies the client that the current item has changed in some way


I don't understand, can you show an example ?

Thanks in advance



Добавлено 12.2.11 06:34

and whenever i try to to subscribe, the phone restart. I use this from IMusicServer

Код:
Subscribe(ICBMusicServer* pICBMusicServer,u16 msgBase,int clientData,unsigned long * pSubscriptionHandle);


 den_po:
12.02.11, 01:52
 blacklizard, смотри IMusicServer::Start и IMusicServer::Subscribe.
для начала напиши свой класс, реализующий все методы от IRoot (широко известного как IUnknown) до ICBMusicServer.

 blacklizard:
12.02.11, 22:20
 ok, thanks :)

I will try :)


Добавлено 13.2.11 08:05

den_po, I really need help with the callback.

when ever i use this IMusicServer::Start, phone reboot..

 blacklizard:
17.02.11, 07:25
 Hi, I was trying the new ModifyUIPageHook function to add extra tab in file manager, actually it can be added, but there is a problem though.

I cannot enter the newly created tab. It restart the phone if enter the 4th and 5th tab

Here is the code
Код: 
int CMyBook::HookCB2(void *msg, BOOK* book, PAGE_DESC * page_desc)
{
  bool exists = NULL!=FindBookEx( FindBookExCB_Book, (int*) book );
  //GUI_LIST* blist;
  STOREDBOOKNAME tmp = books.back();
  books.pop_back();
  
  //debug_printf("\n!!! book '%s', page '%s'%s\n", tmp.name.c_str(), page_desc->name, exists ? "" : " killed!");
  
  if( (!strcmp(book->xbook->name, "DataBrowserBook")) && (!strcmp(page_desc->name,"DataBrowser_Main_Page")))
  {  
    if( exists )
    {
      //TabMenuBar_SetTabCount( (GUI_TABMENUBAR*) List_Get(book->xguilist->guilist, 0), 5 );
      TabMenuBar_SetTabIcon( (GUI_TABMENUBAR*) List_Get(book->xguilist->guilist, 0), 3, 0x830, 0 );
      TabMenuBar_SetTabIcon( (GUI_TABMENUBAR*) List_Get(book->xguilist->guilist, 0), 3, 0x831, 1 );
      TabMenuBar_SetTabIcon( (GUI_TABMENUBAR*) List_Get(book->xguilist->guilist, 0), 4, 0x835, 0 );
      TabMenuBar_SetTabIcon( (GUI_TABMENUBAR*) List_Get(book->xguilist->guilist, 0), 4, 0x836, 1 );

      
      //blist = CreateListMenu( book, 0 );
      // ListMenu_SetOnMessage( blist, onLBMessage );
      //ListMenu_SetItemCount( blist, 5 );
      
      TabMenuBar_SetTabGui( (GUI_TABMENUBAR*) List_Get(book->xguilist->guilist, 0), 3, (GUI*)List_Get(book->xguilist->guilist, 1));
      TabMenuBar_SetTabGui( (GUI_TABMENUBAR*) List_Get(book->xguilist->guilist, 0), 4, (GUI*)List_Get(book->xguilist->guilist, 2) );
      TabMenuBar_SetTabTitle((GUI_TABMENUBAR*) List_Get(book->xguilist->guilist, 0), 3, STR( "Internal FS" ) );
      TabMenuBar_SetTabTitle((GUI_TABMENUBAR*) List_Get(book->xguilist->guilist, 0), 4, STR( "Elfs" ) );
      //TabMenuBar_SetFocusedTab( (GUI_TABMENUBAR*) List_Get(book->xguilist->guilist, 0), 0 );
      GUIObject_Show((GUI_TABMENUBAR*) List_Get(book->xguilist->guilist, 0));
    }
  }
  return 0;
}


Прикрепленный к сообщению файл:

scr12-23-39.png scr12-23-39.png (72.08 kb; 210 hits) Скачать файл

 Black_Roland:
17.02.11, 15:53
 Здравствуйте. Подскажите, можно ли как-то получить указатель на структуру книги по ее имени простым способом? Или нужно перебирать все книги, например как в BookManager?
Функция поиска книг в BookManager: 

Вообще мне нужно найти эльф по имени и обезвредить :lol: Заранее спасибо за ответы, плюсануть не смогу :(
Страница 164 из 211: « 1 ... 160 161 162 163 [164] 165 166 167 168 ... 211 »

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

© 2005-2018 supertrubka.org