1
1
// -------------------------------------------------------------------------------- //
2
// Copyright (C) 2008-2010 J.Rios
2
// Copyright (C) 2008-2011 J.Rios
3
3
// anonbeat@gmail.com
5
5
// This Program is free software; you can redistribute it and/or modify
6
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation; either version 2, or (at your option)
7
// the Free Software Foundation; either version 3, or (at your option)
8
8
// any later version.
10
10
// This Program is distributed in the hope that it will be useful,
31
33
// -------------------------------------------------------------------------------- //
32
34
guRaListBox::guRaListBox( wxWindow * parent, guLibPanel * libpanel, guDbLibrary * db, const wxString &label ) :
33
guListBox( parent, db, label, wxLB_MULTIPLE | guLISTVIEW_ALLOWDRAG | guLISTVIEW_HIDE_HEADER )
35
guAccelListBox( parent, db, label )
35
37
m_LibPanel = libpanel;
37
39
m_NormalStar = new wxBitmap( guImage( ( guIMAGE_INDEX ) ( guIMAGE_INDEX_star_normal_tiny + GURATING_STYLE_MID ) ) );
38
40
m_SelectStar = new wxBitmap( guImage( ( guIMAGE_INDEX ) ( guIMAGE_INDEX_star_highlight_tiny + GURATING_STYLE_MID ) ) );
42
CreateAcceleratorTable();
52
56
// -------------------------------------------------------------------------------- //
57
void guRaListBox::CreateAcceleratorTable( void )
59
wxAcceleratorTable AccelTable;
60
wxArrayInt AliasAccelCmds;
61
wxArrayInt RealAccelCmds;
63
AliasAccelCmds.Add( ID_PLAYER_PLAYLIST_SAVE );
64
AliasAccelCmds.Add( ID_PLAYER_PLAYLIST_EDITTRACKS );
65
AliasAccelCmds.Add( ID_SONG_PLAY );
66
AliasAccelCmds.Add( ID_SONG_ENQUEUE_AFTER_ALL );
67
AliasAccelCmds.Add( ID_SONG_ENQUEUE_AFTER_TRACK );
68
AliasAccelCmds.Add( ID_SONG_ENQUEUE_AFTER_ALBUM );
69
AliasAccelCmds.Add( ID_SONG_ENQUEUE_AFTER_ARTIST );
70
AliasAccelCmds.Add( ID_PLAYER_PLAYLIST_SEARCH );
72
RealAccelCmds.Add( ID_RATING_SAVETOPLAYLIST );
73
RealAccelCmds.Add( ID_RATING_EDITTRACKS );
74
RealAccelCmds.Add( ID_RATING_PLAY );
75
RealAccelCmds.Add( ID_RATING_ENQUEUE_AFTER_ALL );
76
RealAccelCmds.Add( ID_RATING_ENQUEUE_AFTER_TRACK );
77
RealAccelCmds.Add( ID_RATING_ENQUEUE_AFTER_ALBUM );
78
RealAccelCmds.Add( ID_RATING_ENQUEUE_AFTER_ARTIST );
79
RealAccelCmds.Add( ID_LIBRARY_SEARCH );
81
if( guAccelDoAcceleratorTable( AliasAccelCmds, RealAccelCmds, AccelTable ) )
83
SetAcceleratorTable( AccelTable );
88
// -------------------------------------------------------------------------------- //
53
89
void guRaListBox::GetItemsList( void )
55
91
m_Db->GetRatings( m_Items );
102
138
int SelCount = GetSelectedCount();
103
139
int ContextMenuFlags = m_LibPanel->GetContextMenuFlags();
105
MenuItem = new wxMenuItem( Menu, ID_RATING_PLAY, _( "Play" ), _( "Play the selected tracks" ) );
141
MenuItem = new wxMenuItem( Menu, ID_RATING_PLAY,
142
wxString( _( "Play" ) ) + guAccelGetCommandKeyCodeString( ID_SONG_PLAY ),
143
_( "Play the selected tracks" ) );
106
144
MenuItem->SetBitmap( guImage( guIMAGE_INDEX_player_tiny_light_play ) );
107
145
Menu->Append( MenuItem );
109
MenuItem = new wxMenuItem( Menu, ID_RATING_ENQUEUE, _( "Enqueue" ), _( "Add current selected tracks to playlist" ) );
110
MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_add ) );
111
Menu->Append( MenuItem );
113
MenuItem = new wxMenuItem( Menu, ID_RATING_ENQUEUE_ASNEXT, _( "Enqueue Next" ), _( "Add current selected tracks to playlist as Next Tracks" ) );
114
MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_add ) );
115
Menu->Append( MenuItem );
146
MenuItem->Enable( SelCount );
148
MenuItem = new wxMenuItem( Menu, ID_RATING_ENQUEUE_AFTER_ALL,
149
wxString( _( "Enqueue" ) ) + guAccelGetCommandKeyCodeString( ID_SONG_ENQUEUE_AFTER_ALL ),
150
_( "Add current selected tracks to playlist" ) );
151
MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_add ) );
152
Menu->Append( MenuItem );
153
MenuItem->Enable( SelCount );
155
wxMenu * EnqueueMenu = new wxMenu();
157
MenuItem = new wxMenuItem( EnqueueMenu, ID_RATING_ENQUEUE_AFTER_TRACK,
158
wxString( _( "Current Track" ) ) + guAccelGetCommandKeyCodeString( ID_SONG_ENQUEUE_AFTER_TRACK ),
159
_( "Add current selected tracks to playlist after the current track" ) );
160
MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_add ) );
161
EnqueueMenu->Append( MenuItem );
162
MenuItem->Enable( SelCount );
164
MenuItem = new wxMenuItem( EnqueueMenu, ID_RATING_ENQUEUE_AFTER_ALBUM,
165
wxString( _( "Current Album" ) ) + guAccelGetCommandKeyCodeString( ID_SONG_ENQUEUE_AFTER_ALBUM ),
166
_( "Add current selected tracks to playlist after the current album" ) );
167
MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_add ) );
168
EnqueueMenu->Append( MenuItem );
169
MenuItem->Enable( SelCount );
171
MenuItem = new wxMenuItem( EnqueueMenu, ID_RATING_ENQUEUE_AFTER_ARTIST,
172
wxString( _( "Current Artist" ) ) + guAccelGetCommandKeyCodeString( ID_SONG_ENQUEUE_AFTER_ARTIST ),
173
_( "Add current selected tracks to playlist after the current artist" ) );
174
MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_add ) );
175
EnqueueMenu->Append( MenuItem );
176
MenuItem->Enable( SelCount );
178
Menu->Append( wxID_ANY, _( "Enqueue after" ), EnqueueMenu );
121
184
Menu->AppendSeparator();
123
MenuItem = new wxMenuItem( Menu, ID_RATING_EDITTRACKS, _( "Edit Songs" ), _( "Edit the selected tracks" ) );
186
MenuItem = new wxMenuItem( Menu, ID_RATING_EDITTRACKS,
187
wxString( _( "Edit Songs" ) ) + guAccelGetCommandKeyCodeString( ID_PLAYER_PLAYLIST_EDITTRACKS ),
188
_( "Edit the selected tracks" ) );
124
189
MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_edit ) );
125
190
Menu->Append( MenuItem );
128
193
Menu->AppendSeparator();
130
MenuItem = new wxMenuItem( Menu, ID_RATING_SAVETOPLAYLIST, _( "Save to PlayList" ), _( "Save the selected tracks to PlayList" ) );
131
MenuItem->SetBitmap( guImage( guIMAGE_INDEX_doc_save ) );
195
MenuItem = new wxMenuItem( Menu, ID_RATING_SAVETOPLAYLIST,
196
wxString( _( "Save to PlayList" ) ) + guAccelGetCommandKeyCodeString( ID_PLAYER_PLAYLIST_SAVE ),
197
_( "Save the selected tracks to PlayList" ) );
198
MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_doc_save ) );
132
199
Menu->Append( MenuItem );
134
201
if( ContextMenuFlags & guLIBRARY_CONTEXTMENU_COPY_TO )
203
Menu->AppendSeparator();
136
204
m_LibPanel->CreateCopyToMenu( Menu, ID_RATING_COPYTO );