Skip to main content
Topic: [crashware] foo_uie_lyrics2 (Read 405985 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[crashware] foo_uie_lyrics2

Reply #25
@nosatyj
you mean adding support for getting the lyrics from it? i'll see what i can do
Hi, this is my first post in HA forums, I've read the forums for a long time, as a guest, but I think It's time to contribute.
I think this code can help You.
I've modified the "ReadLyricFromTag" function from "main.cpp" file. Now It is able to query for any kind of tag.

Code: [Select]
bool ReadLyricFromTag(const metadb_handle_ptr & track, tstring & out)
{
const char * path = track->get_path();

//压缩文件(网络文件等等)不读入Tag
if (strnicmp("file://", path, _countof("file://") - 1))
return false;

if (wildcard_helper::test_path(path, t2u(cfg_skipbyfiletype.get_value()), true))
return false;

tstring tag = cfg_lyric_tag.get_string_ref();
util::replace(tag, ';', '\0');
const file_info * pinfo = 0;
track->metadb_lock();
if (track->get_info_locked(pinfo))
{
for (const tchar * p = tag.c_str(); p - tag.c_str() < (int)tag.length(); p += _tcslen(p) + 1)
{
while (0 == *p || ' ' == *p || '\t' == *p)
++p;
if (p - tag.c_str() >= (int)tag.length())
break;

service_ptr_t<titleformat_object> script_tag;

pfc::string8 out_tmp;

static_api_ptr_t<titleformat_compiler>()->compile_safe(script_tag, t2u(p) );

track->format_title( NULL, out_tmp, script_tag, NULL );


//if( out_tmp.get_length() != 0 && out_tmp != pfc::string8("?") ) //Secure version
if( out_tmp.get_length() > 1 ) //Faster version
{
out = u2t( out_tmp.get_ptr()  );
track->metadb_unlock();
return true;
}
}
}
track->metadb_unlock();
return false;
}

If You want to implement this method, You must change the "Read lyric from field" configuration, adding "%" characters at the beginning and end of tags.
This can be done in two ways:
1: example (from "vars.cpp" file ):
change line 90:
Code: [Select]
 "cfg_wstring  cfg_lyric_tag(guid_lyric_tag, L"LYRICS;UNSYNCED LYRICS");"
To:
Code: [Select]
"cfg_wstring  cfg_lyric_tag(guid_lyric_tag, L"%LYRICS%;%UNSYNCED LYRICS%");"

2: Building a temp string whith the "%" character at the beginning and end using:
Code: [Select]
tstring current_tag = L"%";
curent_tag.append( p );
curent_tag.append( L"%" );
static_api_ptr_t<titleformat_compiler>()->compile_safe(script_tag, t2u(curent_tag.c_str()) );

The only problem I can find with my function is that if the tag's content has only the "?" character, isn't detected as a valid tag, but I think this isn't a real problem because a lyric can't be just a "?" character.

[crashware] foo_uie_lyrics2

Reply #26
I have a problem with version 0.4.2 - it fails to find in internet and download any lyrics for tracks with Cyrillic characters in artist and title fields (songs of Russian artists). Version 0.4.1 didn't have this problem - I tried both versions with the same tracks and the same settings: v. 0.4.1 does find and download lyrics, v. 0.4.2 doesn't. Probably something is broken with local charset support... I had to roll back to v. 0.4.1.

[crashware] foo_uie_lyrics2

Reply #27
Thank you Michael87 for further developing, I especially like the separation of synced and unsynced lyrics.

But can you tell me what does "Enable Global Field Processing" in the Misc Tab mean?

[crashware] foo_uie_lyrics2

Reply #28
Hey, thank you for further developing this component!

But I'm experiencing an annoying problem. If I search for lyrics by hand, and (it seems that) the plugin can't find the lyrics, it just goes on and on with "searching for lyric", until i click "close" instead of just telling me that it can't find any.

[crashware] foo_uie_lyrics2

Reply #29
Yeah actually, I don't think the search online function works anymore.  My queries always fail, regardless of whether there are Unicode characters in there.

[crashware] foo_uie_lyrics2

Reply #30
Yeah actually, I don't think the search online function works anymore.  My queries always fail, regardless of whether there are Unicode characters in there.


I've got the same problem. but i think it's server issue, not component's.. i think it worked earlier today or maybe yesterday..

Or it was in previous version maybe..  Can't recall..

Beside that, i've got no bugs to report. Everything goes smooth for now.
Disregard the constabulary.

[crashware] foo_uie_lyrics2

Reply #31
It's good to see this plugin developed again, but I've got one question: In the previous version, the results in the Online search window, it was obvious whether the result was a timestamped .lrc file or a (usually) unstamped .txt file. With this version, I can't see that anymore. I'd like to have this functionality back.

[crashware] foo_uie_lyrics2

Reply #32
Yeah actually, I don't think the search online function works anymore.  My queries always fail, regardless of whether there are Unicode characters in there.


I've got the same problem. but i think it's server issue, not component's.. i think it worked earlier today or maybe yesterday..

Or it was in previous version maybe..  Can't recall..

Beside that, i've got no bugs to report. Everything goes smooth for now.


It's never worked for me since I first installed the new version 3 days ago.

[crashware] foo_uie_lyrics2

Reply #33
Online search works for me with the latest version, except for Cyrillic titles.

[crashware] foo_uie_lyrics2

Reply #34
Thank's Michael87!

@ anyone

Is there a way to display the timestamped lyrics without having them move across the screen.

I thought this was what disabeling the scroll function would do. But this only slows down the scroll so that they move row by row instead of the soft roll.

Is there a way to get them to stand still (and be scrolled manually) or is there a way to disable downloading of synced lyrics.
(or is there another component that does this)

@ Michael87

$if($not(%above%,
Could it be possible to implement this function in this component. I would imagine more peole than me would be happy with this possibility.
,))

Peace
Levi

[crashware] foo_uie_lyrics2

Reply #35
I agree with the above suggestion too. Synced lyrics should be manually scrollable too. It would be also great if there was an ability to scroll manually even if automatic scrolling is enabled (so that using mouse wheel or click-and-drag in lyrics window stops autoscrolling and allows to scroll manually).

[crashware] foo_uie_lyrics2

Reply #36
Visual bug on assume default charset. If I select "936 ANSI/OEM (Simplified Chinese GBK)", when I close the preference page and reopen it, it selects "949 ANSI/OEM (Korean)" instead. However, the intended option is saved, my charset gets assumed correctly.

On another note, online search seems to fail to work for me.
:)

[crashware] foo_uie_lyrics2

Reply #37
Thanks for continuing the development of this plugin!

I tried the latest version I have some observations. The rating feature seems to be flawed. Because it always tries to rate on viewlyrics.com even is the lyrics were downloaded from another site, and that means it tries to rate something that doesn't exist.
The online search functionality seems to have problems. It seems like I only get results from lyrDB and always only one result. Previously I got multiple results for popular song and I could choose the best version. I only guess its from lyrDB because the uploader column always has lyrDB in it. Like others mentioned earlier it would be good to get somekind of feedback for what is happening when searching for lyrics. That way it would be easier to tell why don't I get the proper results.

[crashware] foo_uie_lyrics2

Reply #38
Thanks for working on this plugin, i have recently moved to Foobar after using Songbird for the last year and finding a working lyrics plugin was the main thing stopping me from changing earlier.
I have a few suggestions for the next version:

*First im not sure if this is the plugin or something i am doing wrong but evertime un-synced lyrics are downloaded there is a tag at the bottom ie: <!--f0c25b539901624b460e129d15264305-->. Is it possible for the plugin to remove this before saving the lyrics? There is no issue with synced lyrics.

*I prefer unsynced lyrics so an option to choose what kind of lyrics are searched for and what sites are searched would be great.

*I find for my collection of mostly obscure metal and alternative music the sites searched by the Lyricmaster plugin (http://addons.songbirdnest.com/addon/1230) i was using with songbird to be much faster and alot more accurate, finding most of my lyrics instantly (admittedly lyricmaster only does unsynced lyrics). I never needed to save the lyrics with songbird as the searching was so fast, frequently with this plugin the singing will have started before the lyrics have been found. Using the database searched by lyricmaster along with more options controlling what was searched would make this plugin perfect.

Cheers

[crashware] foo_uie_lyrics2

Reply #39
foo_uie_lyrics2 0.4.3 is out!

Finally support for multiple lyrics (aka "Next lyrics" button) & a lot more!

Thank you for all your reports & suggestion!



@s33m33 (If it's possible, please add keyboard shortcut option to embed lyrics in current playing track.):

I have added "Save" and "Save to tag"  to the contextmenu.
If you like to have keyboard shortcuts anyway, I can add them in the next version (0.4.4)

@スラッシュ:
added in 0.4.3 !


@Andu:
yeah a progress bar would be difficult, i'll check it out, maybe i'll add one in 0.4.4

@janu:
thanks for the code! added in 0.4.3

@Alexander B:
viewlyrics support was somewhat broken in 0.4.3 should now work again.

@bubi jackson:
i have renamed it ;-)

@drfakeacc, neothe0ne and dreadroach:
(should) be fixed in 0.4.3, however I have rewritten this part a lot, so if it still makes trouble, feel free to report it

@pappaapa and Alexander B:
added in 0.4.3

@n0obie4life:
thanks for the report,
  • fixed

    @mzso:
    i have removed the rating for now, because only viewlyrics supports it currently

    @Ab0rt0:
    thanks for the report, lyrdb is now filtered correctly
    i have also added 3 new datbases in 0.4.3, if you'd like support for specific metal/alternative lyrics db, just give me the url & i'll see what i can do (a db with api support would be best)

[crashware] foo_uie_lyrics2

Reply #40
Thanks for updating this great plug-in.

Furthermore, could you add one of the korean lyrics site into the lyrics database inside the plug-in?
The site is "http://www.alsong.co.kr/".

For the reference just in case, I'm linking the page which explains how to retrieve the lyrics from the above site.

http://mudchobo.tomeii.com/tt/443

I hope that you can find some clue from this page.
(Unfortunately, the language of the page is korean.)


[crashware] foo_uie_lyrics2

Reply #41
Michael87, thanks for the new version.
Unfortunately, no luck with online search with this version too. This time lyrics for neither Unicode, nor for plain ASCII titles get downloaded. If I enable debug output, it continuously writes "foo_uie_lyrics2: ReadInternetText: HttpSendRequest failed." to the console multiple times for each track (for every source, I guess).

[crashware] foo_uie_lyrics2

Reply #42
Furthermore, could you add one of the korean lyrics site into the lyrics database inside the plug-in?
The site is "http://www.alsong.co.kr/".
...


Thanks for the detailed information, I will add it in the next version (0.4.4)

[crashware] foo_uie_lyrics2

Reply #43
Michael87, thanks for the new version.
Unfortunately, no luck with online search with this version too. This time lyrics for neither Unicode, nor for plain ASCII titles get downloaded. If I enable debug output, it continuously writes "foo_uie_lyrics2: ReadInternetText: HttpSendRequest failed." to the console multiple times for each track (for every source, I guess).


hmm , i can only imagine two causes for this problem.

Could you give me some example input for artist & title please?

Also, are you directly connected to the internet, or using a proxy server?

Edit:
you can also check your proxy settings in internet ->  proxy settings,
if you have currently selected "use internet explorer setting" you could try "no proxy server"

[crashware] foo_uie_lyrics2

Reply #44
Thanks a lot for the additions! Great stuff  This is working great now, but if I think of anything else, I'll drop a line.

[crashware] foo_uie_lyrics2

Reply #45
Quote
@s33m33 (If it's possible, please add keyboard shortcut option to embed lyrics in current playing track.


Michael87, thanks for the context option "Save to tag" for embedding lyrics. It's much easier to access now. 

Being a panel-specific context menu, it doesn't show up when attempting to bind a keyboard shortcut.
Hence, unable to bind a keyboard shortcut to embed lyrics.

EDIT: Online search works great. Thanks for the fix.


[crashware] foo_uie_lyrics2

Reply #47
released 0.4.4

thanks to the uploaded crashdumps i was able to fix two critical crash causes, there's now also keyboard shortcut support for all important commands


@widerock:
i have postponed alsong support to 0.4.5 -  i have to extend the current db interface a bit for it

@bubbi jackson:
the setting enables/disables the foobar2000 variables like %lyric_currentline%

[crashware] foo_uie_lyrics2

Reply #48
Nice Work, Michael87!

I have several small questions to report:
Firstly, it's cool that the internet datebases can been selected, and SHE will find the English lyrics rapidly, but I still can't find
any lyrics for the Chinese songs, and the "ailrc.com" have been selected. I don't know where the problems lies.

Secondly, I don't know if the "internet databases" have Priority and the plug-in will search the lyrics auto by the speed? If it have,
is it necessary to array resources by the order? Another issue is if we can add the resources manually? My thread is that the dialog-box
shows like this:
There are two display boxs about "Active source list" and "Avaiable source list", and supply the function key "-->", "<--", "Up", "Down",
espically"Add". It's similar with the setting dialog-box of "DSP manager" and "Biography server".

Thirdly, I suggest the command order should been adjusted. Because the command"Online search" maybe used frequently, it'll be better
to put it in the first position.

Just for discussion, THX!


[crashware] foo_uie_lyrics2

Reply #49
ADD-ON:
I have been testing the lyrics plug-in further, it can do find some lyrics for some popular Chinese songs, eg:王力宏 - 龙的传人, but the lyrics CAN'T MATCH the songs, and if it's English songs by the Chinese singers, for example:王菲 - Eyes on me, the results will be right. I'm actually be confused.
I guess the keyword--title and artist in Chinese character will lead to the erroneous results. Please look into and find the problem, thanks!

 
SimplePortal 1.0.0 RC1 © 2008-2019