diff --git a/themes/eole/js/WSHfilter.js b/themes/eole/js/WSHfilter.js index ca1e434..f56bd95 100644 --- a/themes/eole/js/WSHfilter.js +++ b/themes/eole/js/WSHfilter.js @@ -72,16 +72,15 @@ var properties = { scrollRowDivider: window.GetProperty("SYSTEM Scroll Row Divider", 1), tf_artist: fb.TitleFormat("%artist%"), tf_albumartist: fb.TitleFormat("%album artist%"), - tf_groupkey_genre: window.GetProperty("_PROPERTY Genre TitleFormat", "$if2($meta(genre,0),?)"), - tf_groupkey_genre_default: "$if2($meta(genre,0),?)", - tf_groupkey_artist: window.GetProperty("_PROPERTY Artist TitleFormat", "$if2($meta(artist),?)"), - tf_groupkey_artist_default: "$if2($meta(artist),?)", + tf_groupkey_genre: window.GetProperty("_PROPERTY Genre TitleFormat", "$if2($meta_sep(genre,';'),?)"), + tf_groupkey_genre_default: "$if2($meta_sep(genre,';'),?)", + tf_groupkey_artist: window.GetProperty("_PROPERTY Artist TitleFormat", "$if2($meta_sep(artist,';'),?)"), + tf_groupkey_artist_default: "$if2($meta_sep(artist,';'),?)", tf_groupkey_album: window.GetProperty("_PROPERTY Album TitleFormat", "%album artist% ^^ %album%"), tf_groupkey_album_default: "%album artist% ^^ %album%", - tf_groupkey_album_addinfos: " ## %title% ## %date%", albumsTFsortingdefault: "%album artist% | %date% | %album% | %discnumber% | %tracknumber% | %title%", - artistsTFsortingdefault: "$meta(artist) | %date% | %album% | %discnumber% | %tracknumber% | %title%", - genresTFsortingdefault: "$meta(genre,0) | %album artist% | %date% | %album% | %discnumber% | %tracknumber% | %title%", + artistsTFsortingdefault: "%date% | %album% | %discnumber% | %tracknumber% | %title%", + genresTFsortingdefault: "%album artist% | %date% | %album% | %discnumber% | %tracknumber% | %title%", tf_sort_genre_default: "%album artist% | %date% | %album% | %discnumber% | %tracknumber% | %title%", tf_sort_artist_default: "%date% | %album% | %discnumber% | %tracknumber% | %title%", tf_sort_album_default: "%date% | %album% | %discnumber% | %tracknumber% | %title%", @@ -1823,6 +1822,9 @@ oGroup = function(index, start, handle, groupkey, sortkey) { this.load_requested = 0; this.save_requested = false; this.cover_formated = false; + this.tra = []; + this.traIndex = []; + this.pl = new FbMetadbHandleList; this.finalize = function(count, tracks, handles) { this.tra = tracks.slice(0); this.pl = handles.Clone(); @@ -2165,13 +2167,12 @@ oBrowser = function(name) { plman.SetPlaylistSelection(g_active_playlist, affectedItems, true); }; this.init_groups = function() { + //gTime_group = fb.CreateProfiler(); + //gTime_group.Reset(); + //console.log("Group populate started time:"+gTime_group.Time); var handle = null; - var current = ""; - var previous = ""; - var g = 0, t = 0; + var g = 0; var arr = []; - var tr = []; - var pl = new FbMetadbHandleList(); var total = this.list.Count; var t_all = 0; var tr_all = []; @@ -2179,15 +2180,10 @@ oBrowser = function(name) { var flag = []; var default_grouping = false; this.groups.splice(0, this.groups.length); - switch(properties.tagMode) { case 1: // album - if(properties.tf_groupkey_album==properties.tf_groupkey_album_default){ - default_grouping = true; - var tf = fb.TitleFormat(properties.tf_groupkey_album+properties.tf_groupkey_album_addinfos); - } else - var tf = fb.TitleFormat(properties.tf_groupkey_album+properties.tf_groupkey_album_addinfos+" ## "+properties.tf_groupkey_album_default); - break; + var tf = fb.TitleFormat(properties.tf_groupkey_album); + break; case 2: // artist var tf = fb.TitleFormat(properties.tf_groupkey_artist); break; @@ -2197,96 +2193,96 @@ oBrowser = function(name) { }; var str_filter = process_string(filter_text); var previous_item_genre = "123456789"; - for(var i = 0; i < total; i++) { - handle = this.list[i]; - arr = tf.EvalWithMetadb(handle).split(" ## "); - current = arr[0].toLowerCase(); + var tf_album = fb.TitleFormat('%album%'); + var tf_artist = fb.TitleFormat('%artist%'); + var tf_date = fb.TitleFormat('%date%'); + var tf_title = fb.TitleFormat('%title%'); - if(str_filter.length > 0) { - var comp_str = (arr.length > 1 ? arr[0]+" "+arr[1] : arr[0]); - var toAdd = match(comp_str, str_filter); - } else { - var toAdd = true; - }; - if(toAdd) { - if(current != previous && !flag["#"+current]) { - if(this.current_sourceMode == 1 || this.current_sourceMode == 3) { - flag["#"+current] = true; + var groupcache = []; + for(var i = 0; i < total; i++) { + handle = this.list[i]; + arr = tf.EvalWithMetadb(handle).split(";"); + var added = false; + + for (var j = 0; j < arr.length; j++) { + //Get index containing the non-1st genre, use groupcache rather than this.groups for performance + var dest = groupcache.indexOf(arr[j]); + if (dest == -1) { //If returns index of -1, group does not exist; create + //Push group to groupcache and sort array + groupcache.push(arr[j]); + groupcache.sort(); + dest = groupcache.indexOf(arr[j]); + //Create new group at sorted index + this.groups.splice(dest, 0, new oGroup(g, i, handle, arr[j], arr[j])); + //Add song to group playlist + this.groups[dest].pl.Add(handle); + //Add to aggregate item, 'added' used to prevent duplicate entries on multiple value tags + if (added == false) { + if(properties.showAllItem) { + tr_all.push(arr[j]); + pl_all.Add(handle); + } + t_all++; + added = true; } - if(g > 0) { - // update current group - this.groups[g-1].finalize(t, tr, pl); - tr.splice(0, t); - pl.RemoveAll(); - t = 0; - }; - if(i < total) { - // add new group - tr.push(arr[1]); - pl.Add(handle); - if(properties.showAllItem) { - tr_all.push(arr[1]); - pl_all.Add(handle); - }; - t_all++; - t++; - this.groups.push(new oGroup(g+1, i, handle, arr[0], arr[0])); - g++; - this.groups[g-1].date = arr[2]; - if(properties.tagMode==1){ - if(default_grouping){ - var artist_album = arr[0].split(" ^^ "); - } else { - var artist_album = arr[3].split(" ^^ "); - } - this.groups[g-1].artist_name = artist_album[0]; - this.groups[g-1].album = artist_album[1]; + //Set group date, artist, album, and add track titles to array + this.groups[dest].date = tf_date.EvalWithMetadb(handle); + this.groups[dest].artist_name = tf_artist.EvalWithMetadb(handle); + this.groups[dest].album = tf_album.EvalWithMetadb(handle); + this.groups[dest].tra.push(tf_title.EvalWithMetadb(handle)); + this.groups[dest].traIndex.push(i); + //Update group count + g++; + } else { //Add track to group if the group exists + //Compare track index against group index, allows for sorting based on group sorting while + //being much faster overall compared to the OrderByFormat function + if (this.groups[dest].traIndex[0] > i) { + this.groups[dest].pl.Insert(0, handle); + this.groups[dest].start = i; + } else { + this.groups[dest].pl.Insert(this.groups[dest].count, handle); + } + //Add to aggregate item + if (added == false) { + if(properties.showAllItem) { + tr_all.push(arr[j]); + pl_all.Add(handle); } - previous = current; - }; - } else { - // add track to current group - tr.push(arr[1]); - pl.Add(handle); - if(properties.showAllItem) { - tr_all.push(arr[1]); - pl_all.Add(handle); - }; - t_all++; - t++; - }; - }; - }; - if(g > 0) { - // update last group properties - this.groups[g-1].finalize(t, tr, pl); - //this.groups[g-1].date = arr[2]; - - /*if(properties.tagMode==1){ - if(default_grouping){ - var artist_album = arr[0].split(" ^^ "); - } else { - var artist_album = arr[3].split(" ^^ "); + t_all++; + added = true; + } + //Add title to array + this.groups[dest].tra.push(tf_title.EvalWithMetadb(handle)); + //Update group item count + this.groups[dest].count += 1; } - this.groups[g-1].artist_name = artist_album[0]; - this.groups[g-1].album = artist_album[1]; - }*/ - - //this.groups[g-1].artist_name = arr[4]; - // add 1st group ("ALL" item) - if(properties.showAllItem && g > 1) { - this.groups.unshift(new oGroup(0, 0, null, null,"")); - this.groups[0].finalize(t_all, tr_all, pl_all); - }; - }; + } + }; + + //Update group metadb & index (needed for correct 1st item thumbnail) and remove prefixes if set + for (var i = 0; i < g; i++) { + this.groups[i].index = i; + this.groups[i].metadb = this.groups[i].pl[0]; + if (properties.tagMode != 2) { + this.groups[i].cachekey = process_cachekey(this.groups[i].metadb); + } + if(properties.removePrefix) this.groups[i].removePrefix(); + } + + // add 1st group ("ALL" item) + if(properties.showAllItem && g > 1) { + this.groups.unshift(new oGroup(0, 0, null, null,"")); + this.groups[0].finalize(t_all, tr_all, pl_all); + }; + if(properties.removePrefix) this.sort(); // free memory - tr.splice(0, tr.length); tr_all.splice(0, tr_all.length); flag.splice(0, flag.length); - pl.RemoveAll(); + groupcache.splice(0, groupcache.length); pl_all.RemoveAll(); + //console.log("Group populate finished time:"+gTime_group.Time); }; this.sort = function() { function noPrefixSorting(a,b) { @@ -2327,37 +2323,22 @@ oBrowser = function(name) { // define sort order switch(properties.tagMode) { case 1: // album - if(properties.tf_groupkey_album == properties.tf_groupkey_album_default){ - if(properties.tf_sort_album=='') var TFsorting = properties.albumsTFsortingdefault; - else var TFsorting = properties.tf_groupkey_album_default + " | " + properties.tf_sort_album; - this.customGroups = false; - } else { - if(properties.tf_sort_album=='') var TFsorting = properties.tf_groupkey_album + " | " + properties.tf_sort_album_default; - else var TFsorting = properties.tf_groupkey_album + " | " + properties.tf_sort_album; - this.customGroups = true; - } + if(properties.tf_groupkey_album == properties.tf_groupkey_album_default) this.customGroups = false; + else this.customGroups = true; + if(properties.tf_sort_album=='') properties.tf_sort_album = properties.albumsTFsortingdefault; + var TFsorting = properties.tf_sort_album; break; case 2: // artist - if(properties.tf_groupkey_artist == properties.tf_groupkey_artist_default) { - if(properties.tf_sort_artist=='') var TFsorting = properties.artistsTFsortingdefault; - else var TFsorting = properties.tf_groupkey_artist_default + " | " + properties.tf_sort_artist; - this.customGroups = false; - } else { - if(properties.tf_sort_artist=='') var TFsorting = properties.tf_groupkey_artist + " | " + properties.tf_sort_artist_default; - else var TFsorting = properties.tf_groupkey_artist + " | " + properties.tf_sort_artist; - this.customGroups = true; - } + if(properties.tf_groupkey_artist == properties.tf_groupkey_artist_default) this.customGroups = false; + else this.customGroups = true; + if(properties.tf_sort_artist=='') properties.tf_sort_artist = properties.artistsTFsortingdefault; + var TFsorting = properties.tf_sort_artist; break; case 3: // genre - if(properties.tf_groupkey_genre == properties.tf_groupkey_genre_default) { - if(properties.tf_sort_genre=='') var TFsorting = properties.genresTFsortingdefault; - else var TFsorting = properties.tf_groupkey_genre_default + " | " + properties.tf_sort_genre; - this.customGroups = false; - } else { - if(properties.tf_sort_genre=='') var TFsorting = properties.tf_groupkey_genre + " | " + properties.tf_sort_genre_default; - else var TFsorting = properties.tf_groupkey_genre + " | " + properties.tf_sort_genre; - this.customGroups = true; - } + if(properties.tf_groupkey_genre == properties.tf_groupkey_genre_default) this.customGroups = false; + else this.customGroups = true; + if(properties.tf_sort_genre=='') properties.tf_sort_genre = properties.genresTFsortingdefault; + var TFsorting = properties.tf_sort_genre; break; }; diff --git a/themes/eole/js/WSHgraphicbrowser_trackinfos.js b/themes/eole/js/WSHgraphicbrowser_trackinfos.js index eb63748..3e9089e 100644 --- a/themes/eole/js/WSHgraphicbrowser_trackinfos.js +++ b/themes/eole/js/WSHgraphicbrowser_trackinfos.js @@ -177,6 +177,11 @@ var properties = { showlistCoverMargin:28, load_image_from_cache_direct:true, veryTighCoverActiveZone: window.GetProperty("COVER Small active zone", false), + groupCustomFirstRow: window.GetProperty("MAINPANEL Library Custom Group First Row", false), + groupCustomFirstRowTF: window.GetProperty("MAINPANEL Library Custom Group First Row TitleFormat", ""), + groupCustomSecondRow: window.GetProperty("MAINPANEL Library Custom Group Second Row", false), + groupCustomSecondRowTF: window.GetProperty("MAINPANEL Library Custom Group Second Row TitleFormat", ""), + //disableGroupHeader: window.GetProperty("MAINPANEL Library Group Header Disable", false), } properties.show2linesCustomTag_tf = fb.TitleFormat(properties.show2linesCustomTag); properties.smooth_scroll_value = properties.smooth_scroll_value < 0 ? 0 : properties.smooth_scroll_value > 0.9 ? 0.9 : properties.smooth_scroll_value; @@ -1810,8 +1815,8 @@ oShowList = function(parentPanelName) { if(properties.TFgrouping!=""){ var groupinfos_rows = TF.grouping.EvalWithMetadb(this.pl[0]).split(" ^^ "); - this.firstRow = brw.groups[this.idx].secondRow+this.date; - this.secondRow = brw.groups[this.idx].firstRow; + this.firstRow = ((properties.groupCustomFirstRow == true) ? fb.TitleFormat(properties.groupCustomFirstRowTF).EvalWithMetadb(this.pl[0]) : brw.groups[this.idx].secondRow+this.date); + this.secondRow = ((properties.groupCustomSecondRow == true) ? fb.TitleFormat(properties.groupCustomSecondRowTF).EvalWithMetadb(this.pl[0]) : brw.groups[this.idx].firstRow); } if(!this.album_info_sent && !this.avoid_sending_album_infos && trackinfoslib_state.isActive() && nowplayinglib_state.isActive() && properties.right_panel_follow_cursor && !avoidShowNowPlaying) { window.NotifyOthers("trigger_on_focus_change_album",{ @@ -2293,9 +2298,9 @@ oShowList = function(parentPanelName) { if(this.delta > 0) { this.y = Math.round(eval(this.parentPanelName+".y") + ((this.rowIdx + 1) * eval(this.parentPanelName+".rowHeight")) + eval(this.parentPanelName+".marginTop") - scroll_); if(this.y > 0 - (eval(this.parentPanelName+".h") + this.h) && this.y < eval(this.parentPanelName+".y") + eval(this.parentPanelName+".h")) { - - var slh = Math.floor(this.delta_ < (this.marginTop+this.marginBot) ? 0 : this.delta_ - (this.marginTop+this.marginBot)); - + + var slh = Math.floor(this.delta_ < (this.marginTop+this.marginBot) ? 0 : this.delta_ - (this.marginTop+this.marginBot)); + if(properties.showListColoredBlurred) { try { gr.DrawImage(this.g_wallpaperImg, this.x, this.y + this.marginTop, this.w + g_scrollbar.w, slh+1, 0, 0, this.g_wallpaperImg.Width, this.g_wallpaperImg.Height); @@ -2316,14 +2321,14 @@ oShowList = function(parentPanelName) { } else gr.FillSolidRect(this.x, this.y + this.marginTop, this.w + g_scrollbar.w, slh+1, this.color_showlist_arrow); if(slh > 0) { - // draw Album Selected Arrow + // draw Album Selected Arrow var arrowItemIdx = (this.drawn_idx % brw.totalColumns) + 1; var arrow_x = brw.marginLR + (arrowItemIdx * brw.thumbnailWidth) - Math.round((brw.thumbnailWidth) / 2) - 13; var arrow_y = this.y - 4; var arrow_offsetY = Math.floor((this.delta_ / (this.delta*brw.rowHeight)) * 19); if(arrow_offsetY > 16) arrow_offsetY = 17; gr.DrawImage(this.showListArrow, arrow_x, arrow_y + (9 - arrow_offsetY)+this.marginTop, 27, arrow_offsetY, 0, 0, 27, 17, 0, 255); - + //top gr.FillSolidRect(this.x, this.y+this.marginTop, arrow_x-this.x+2, 1, this.border_color); gr.FillSolidRect(this.x+arrow_x-this.x+24, this.y+this.marginTop, this.w-arrow_x-25, 1, this.border_color); @@ -2418,34 +2423,36 @@ oShowList = function(parentPanelName) { var genre_font = g_font.normal; } - gr.GdiDrawText(this.firstRow, first_row_font, first_row_color, tx+4, ty, this.w - this.MarginRight - 40 - this.timeTextLenght, item_height, DT_LEFT | DT_BOTTOM | DT_CALCRECT | DT_END_ELLIPSIS | DT_NOPREFIX); - gr.GdiDrawText(this.secondRow, second_row_font, second_row_color, tx+4, ty + 8+g_fsize, this.w - this.MarginRight - 25 - this.genreTextLenght, item_height, DT_LEFT | DT_BOTTOM | DT_CALCRECT | DT_END_ELLIPSIS | DT_NOPREFIX); - //if(!trackinfostext_state.isActive() || !(trackinfoslib_state.isActive() && nowplayinglib_state.isActive())){ - gr.GdiDrawText(this.length+', '+this.total_tracks, g_font.normal, this.colorSchemeTextFaded, (brw.groups_draw.length>1) ? tx-32 : tx-13, ty-2, this.text_w, item_height, DT_RIGHT | DT_BOTTOM | DT_CALCRECT | DT_END_ELLIPSIS | DT_NOPREFIX); - gr.GdiDrawText(genreText, genre_font, genre_color, tx-13, ty + item_height +1, this.text_w, item_height, DT_RIGHT | DT_BOTTOM | DT_CALCRECT | DT_END_ELLIPSIS | DT_NOPREFIX); - // close button - if(slh > this.paddingBot*2 && brw.groups_draw.length>1) { - this.close_bt.draw(gr, this.x+this.w-this.MarginRight-4-rightfix, ty +17-this.close_bt.img[0].Height, 255); - } - //} - if(typeof this.firstRowLength == 'undefined') this.firstRowLength = gr.CalcTextWidth(this.firstRow,g_font.italicplus5); - if(typeof this.secondRowLength == 'undefined') this.secondRowLength = gr.CalcTextWidth(this.secondRow,g_font.plus2); - - if(properties.TFgrouping==""){ - this.links.album.setPosition( tx+4, ty,this.firstRowLength,item_height); - this.links.artist.setPosition( tx+4, ty + 8+g_fsize,this.secondRowLength,item_height); - this.links.genre.setPosition( tx-13+this.text_w-this.genreTextLenght, ty + item_height,this.genreTextLenght,item_height); - } else { - this.links.album.changeState(ButtonStates.hide); - this.links.artist.changeState(ButtonStates.hide); - this.links.genre.setPosition( tx-13+this.text_w-this.genreTextLenght, ty + item_height,this.genreTextLenght,item_height); - } - - this.TopInfoY = ty; - this.TopInfoHeight = 18+g_fsize*3; + //if (!properties.disableGroupHeader) { + gr.GdiDrawText(this.firstRow, first_row_font, first_row_color, tx+4, ty, this.w - this.MarginRight - 40 - this.timeTextLenght, item_height, DT_LEFT | DT_BOTTOM | DT_CALCRECT | DT_END_ELLIPSIS | DT_NOPREFIX); + gr.GdiDrawText(this.secondRow, second_row_font, second_row_color, tx+4, ty + 8+g_fsize, this.w - this.MarginRight - 25 - this.genreTextLenght, item_height, DT_LEFT | DT_BOTTOM | DT_CALCRECT | DT_END_ELLIPSIS | DT_NOPREFIX); + //if(!trackinfostext_state.isActive() || !(trackinfoslib_state.isActive() && nowplayinglib_state.isActive())){ + gr.GdiDrawText(this.length+', '+this.total_tracks, g_font.normal, this.colorSchemeTextFaded, (brw.groups_draw.length>1) ? tx-32 : tx-13, ty-2, this.text_w, item_height, DT_RIGHT | DT_BOTTOM | DT_CALCRECT | DT_END_ELLIPSIS | DT_NOPREFIX); + gr.GdiDrawText(genreText, genre_font, genre_color, tx-13, ty + item_height +1, this.text_w, item_height, DT_RIGHT | DT_BOTTOM | DT_CALCRECT | DT_END_ELLIPSIS | DT_NOPREFIX); + // close button + if(slh > this.paddingBot*2 && brw.groups_draw.length>1) { + this.close_bt.draw(gr, this.x+this.w-this.MarginRight-4-rightfix, ty +17-this.close_bt.img[0].Height, 255); + } + //} + if(typeof this.firstRowLength == 'undefined') this.firstRowLength = gr.CalcTextWidth(this.firstRow,g_font.italicplus5); + if(typeof this.secondRowLength == 'undefined') this.secondRowLength = gr.CalcTextWidth(this.secondRow,g_font.plus2); + + if(properties.TFgrouping==""){ + this.links.album.setPosition( tx+4, ty,this.firstRowLength,item_height); + this.links.artist.setPosition( tx+4, ty + 8+g_fsize,this.secondRowLength,item_height); + this.links.genre.setPosition( tx-13+this.text_w-this.genreTextLenght, ty + item_height,this.genreTextLenght,item_height); + } else { + this.links.album.changeState(ButtonStates.hide); + this.links.artist.changeState(ButtonStates.hide); + this.links.genre.setPosition( tx-13+this.text_w-this.genreTextLenght, ty + item_height,this.genreTextLenght,item_height); + } - this.showToolTip = (this.firstRowLength > (this.w - this.MarginRight - 40 - this.timeTextLenght) || this.secondRowLength > (this.w - this.MarginRight - 40 - this.timeTextLenght)) - } + this.TopInfoY = ty; + this.TopInfoHeight = 18+g_fsize*3; + + this.showToolTip = (this.firstRowLength > (this.w - this.MarginRight - 40 - this.timeTextLenght) || this.secondRowLength > (this.w - this.MarginRight - 40 - this.timeTextLenght)) + //} + } //draw album cover if(properties.showlistShowCover>0 && !(properties.showlistShowCover==1 && properties.right_panel_follow_cursor && trackinfoslib_state.isActive() && nowplayinglib_state.isActive()) && this.idx > -1 && isImage(this.showlist_img) && (this.h-this.delta_)<40){ @@ -3148,6 +3155,9 @@ function draw_settings_menu(x,y,right_align,sort_group){ var _menuBackground = window.CreatePopupMenu(); var _menuRating = window.CreatePopupMenu(); var _menuHeaderBar = window.CreatePopupMenu(); + var _menuGroupHeader = window.CreatePopupMenu(); + var _menuGroupRow1 = window.CreatePopupMenu(); + var _menuGroupRow2 = window.CreatePopupMenu(); var _additionalInfos = window.CreatePopupMenu(); var _dateMenu = window.CreatePopupMenu(); var _filterMenu = window.CreatePopupMenu(); @@ -3275,6 +3285,25 @@ function draw_settings_menu(x,y,right_align,sort_group){ _menuTracklist.AppendMenuSeparator(); + _menuGroupRow1.AppendMenuItem(MF_STRING, 300, "Default"); + _menuGroupRow1.AppendMenuItem(MF_STRING, 301, "Custom title format..."); + _menuGroupRow1.CheckMenuItem(300, !properties.groupCustomFirstRow); + _menuGroupRow1.CheckMenuItem(301, properties.groupCustomFirstRow); + + _menuGroupRow2.AppendMenuItem(MF_STRING, 310, "Default"); + _menuGroupRow2.AppendMenuItem(MF_STRING, 311, "Custom title format..."); + _menuGroupRow2.CheckMenuItem(310, !properties.groupCustomSecondRow); + _menuGroupRow2.CheckMenuItem(311, properties.groupCustomSecondRow); + + _menuGroupRow1.AppendTo(_menuGroupHeader,MF_STRING, "First Row"); + _menuGroupRow2.AppendTo(_menuGroupHeader,MF_STRING, "Second Row"); + //_menuGroupHeader.AppendMenuSeparator(); + //_menuGroupHeader.AppendMenuItem(MF_STRING, 302, "Disable Header"); + //_menuGroupHeader.CheckMenuItem(302, properties.disableGroupHeader); + _menuGroupHeader.AppendTo(_menuTracklist,MF_STRING, "Header"); + + _menuTracklist.AppendMenuSeparator(); + _menuProgressBar.AppendMenuItem(MF_STRING, 21, "No progress bar"); _menuProgressBar.AppendMenuItem(MF_STRING, 24, "White Progress bar"); _menuProgressBar.AppendMenuItem(MF_STRING, 23, "Progress bar according to the album art"); @@ -3744,6 +3773,55 @@ function draw_settings_menu(x,y,right_align,sort_group){ g_wallpaperImg = setWallpaperImg(globalProperties.default_wallpaper, fb.GetNowPlaying()); brw.repaint(); break; + case (idx == 300): + properties.groupCustomFirstRow = false; + window.SetProperty("MAINPANEL Library Custom Group First Row", properties.groupCustomFirstRow); + brw.repaint(); + g_showlist.refresh(); + break; + case (idx == 301): + try { + new_TFsorting = utils.InputBox(window.ID, "Enter a title formatting script.\nYou can use the full foobar2000 title formatting syntax here.\n\nSee http://tinyurl.com/lwhay6f\nfor informations about foobar title formatting.\n\nLeave blank to reset to default.", "Custom Sort Order", properties.groupCustomFirstRowTF, true); + if (!(new_TFsorting == "" || typeof new_TFsorting == 'undefined')) { + properties.groupCustomFirstRowTF = new_TFsorting; + properties.groupCustomFirstRow = true; + window.SetProperty("MAINPANEL Library Custom Group First Row", properties.groupCustomFirstRow); + window.SetProperty("MAINPANEL Library Custom Group First Row TitleFormat", properties.groupCustomFirstRowTF); + } + brw.repaint(); + g_showlist.refresh(); + } + catch(e) {} + break; + case (idx == 310): + properties.groupCustomSecondRow = false; + window.SetProperty("MAINPANEL Library Custom Group Second Row", properties.groupCustomSecondRow); + brw.repaint(); + g_showlist.refresh(); + break; + case (idx == 311): + try { + new_TFsorting = utils.InputBox(window.ID, "Enter a title formatting script.\nYou can use the full foobar2000 title formatting syntax here.\n\nSee http://tinyurl.com/lwhay6f\nfor informations about foobar title formatting.\n\nLeave blank to reset to default.", "Custom Sort Order", properties.groupCustomSecondRowTF, true); + if (!(new_TFsorting == "" || typeof new_TFsorting == 'undefined')) { + properties.groupCustomSecondRowTF = new_TFsorting; + properties.groupCustomSecondRow = true; + window.SetProperty("MAINPANEL Library Custom Group Second Row", true), + window.SetProperty("MAINPANEL Library Custom Group Second Row TitleFormat", properties.groupCustomSecondRowTF); + } else { + properties.groupCustomSecondRow = false; + window.SetProperty("MAINPANEL Library Custom Group Second Row", properties.groupCustomSecondRow); + } + brw.repaint(); + g_showlist.refresh(); + } + catch(e) {} + break; + //case (idx == 302): + // properties.disableGroupHeader = !properties.disableGroupHeader; + // window.SetProperty("MAINPANEL Library Group Header Disable", properties.disableGroupHeader); + // //brw.repaint(); + // g_showlist.refresh(); + // break; case (idx == 328): properties.enableAutoSwitchPlaylistMode = !properties.enableAutoSwitchPlaylistMode; window.SetProperty("MAINPANEL Automatically change displayed playlist", properties.enableAutoSwitchPlaylistMode); @@ -6934,12 +7012,12 @@ function get_colors() { colors.showlist_arrow = GetGrey(25,255); colors.showlist_border_color = GetGrey(255,30); break; - + case 2: //Dark and Coal and Album Art colors.showlist_bg = GetGrey(25, 70); colors.showlist_border_color = GetGrey(255,50); break; - + default: //Pure dark (Main color for tracklist is default grey) colors.showlist_bg = GetGrey(25); colors.showlist_arrow = GetGrey(25,255); @@ -7017,12 +7095,12 @@ function get_colors() { colors.showlist_arrow = GetGrey(255,255); colors.showlist_border_color = GetGrey(210); break; - + case 2: //White and Grey and Album Art colors.showlist_bg = GetGrey(0,10); colors.showlist_border_color = GetGrey(210); break; - + default: //Pure white (Main color for tracklist is default white) colors.showlist_bg = GetGrey(255); colors.showlist_arrow = GetGrey(255,255); @@ -7873,7 +7951,7 @@ function on_focus(is_focused) { /*function on_item_focus_change(){ if(fb.GetNowPlaying() && fb.GetFocusItem(true) && fb.GetFocusItem(true).RawPath==fb.GetNowPlaying().RawPath) fb.CursorFollowPlayback=1; else if (fb.IsPlaying) fb.CursorFollowPlayback=0; -}*/ +}*/g_showlist function on_init() { get_font();