cleaning
This commit is contained in:
@@ -134,7 +134,7 @@ void Browser::EnterPressed()
|
||||
if (s->GetHash() == list[0]->GetHash())
|
||||
Mpd->PlayID(s->GetID());
|
||||
else
|
||||
ShowMessage("%s", message_part_of_songs_added);
|
||||
ShowMessage("%s", MPD::Message::PartOfSongsAdded);
|
||||
}
|
||||
FreeSongList(list);
|
||||
break;
|
||||
@@ -178,7 +178,7 @@ void Browser::SpacePressed()
|
||||
ShowMessage("Added folder: %s", item.name.c_str());
|
||||
Song &s = myPlaylist->Main()->at(myPlaylist->Main()->Size()-list.size());
|
||||
if (s.GetHash() != list[0]->GetHash())
|
||||
ShowMessage("%s", message_part_of_songs_added);
|
||||
ShowMessage("%s", MPD::Message::PartOfSongsAdded);
|
||||
}
|
||||
FreeSongList(list);
|
||||
break;
|
||||
@@ -224,7 +224,7 @@ void Browser::SpacePressed()
|
||||
ShowMessage("Loading playlist %s...", item.name.c_str());
|
||||
Song &s = myPlaylist->Main()->at(myPlaylist->Main()->Size()-list.size());
|
||||
if (s.GetHash() != list[0]->GetHash())
|
||||
ShowMessage("%s", message_part_of_songs_added);
|
||||
ShowMessage("%s", MPD::Message::PartOfSongsAdded);
|
||||
}
|
||||
FreeSongList(list);
|
||||
break;
|
||||
|
||||
@@ -247,14 +247,6 @@ bool Keypressed(int in, const int *key)
|
||||
return in == key[0] || in == key[1];
|
||||
}
|
||||
|
||||
bool SortSongsByTrack(Song *a, Song *b)
|
||||
{
|
||||
if (a->GetDisc() == b->GetDisc())
|
||||
return StrToInt(a->GetTrack()) < StrToInt(b->GetTrack());
|
||||
else
|
||||
return StrToInt(a->GetDisc()) < StrToInt(b->GetDisc());
|
||||
}
|
||||
|
||||
string FindSharedDir(const string &one, const string &two)
|
||||
{
|
||||
if (one == two)
|
||||
|
||||
@@ -37,8 +37,6 @@ class CaseInsensitiveSorting
|
||||
bool operator()(const MPD::Item &, const MPD::Item &);
|
||||
};
|
||||
|
||||
bool SortSongsByTrack(MPD::Song *, MPD::Song *);
|
||||
|
||||
void UpdateSongList(Menu<MPD::Song> *);
|
||||
|
||||
bool Keypressed(int, const int *);
|
||||
|
||||
@@ -345,7 +345,7 @@ void MediaLibrary::AddToPlaylist(bool add_n_play)
|
||||
Mpd->PlayID(s->GetID());
|
||||
}
|
||||
else
|
||||
ShowMessage("%s", message_part_of_songs_added);
|
||||
ShowMessage("%s", MPD::Message::PartOfSongsAdded);
|
||||
}
|
||||
}
|
||||
else if (w == Albums)
|
||||
@@ -362,7 +362,7 @@ void MediaLibrary::AddToPlaylist(bool add_n_play)
|
||||
Mpd->PlayID(s->GetID());
|
||||
}
|
||||
else
|
||||
ShowMessage("%s", message_part_of_songs_added);
|
||||
ShowMessage("%s", MPD::Message::PartOfSongsAdded);
|
||||
}
|
||||
}
|
||||
else if (w == Songs)
|
||||
@@ -428,3 +428,11 @@ void MediaLibrary::AddToPlaylist(bool add_n_play)
|
||||
}
|
||||
}
|
||||
|
||||
bool MediaLibrary::SortSongsByTrack(Song *a, Song *b)
|
||||
{
|
||||
if (a->GetDisc() == b->GetDisc())
|
||||
return StrToInt(a->GetTrack()) < StrToInt(b->GetTrack());
|
||||
else
|
||||
return StrToInt(a->GetDisc()) < StrToInt(b->GetDisc());
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,8 @@ class MediaLibrary : public Screen<Window>
|
||||
protected:
|
||||
void AddToPlaylist(bool);
|
||||
|
||||
static bool SortSongsByTrack(MPD::Song *, MPD::Song *);
|
||||
|
||||
static size_t itsLeftColWidth;
|
||||
static size_t itsMiddleColWidth;
|
||||
static size_t itsMiddleColStartX;
|
||||
|
||||
@@ -25,7 +25,8 @@ using namespace MPD;
|
||||
|
||||
using std::string;
|
||||
|
||||
const char *playlist_max_message = "playlist is at the max size";
|
||||
const char *MPD::Message::PartOfSongsAdded = "Only part of requested songs' list added to playlist!";
|
||||
const char *MPD::Message::FullPlaylist = "Playlist is full!";
|
||||
|
||||
Connection::Connection() : isConnected(0),
|
||||
itsErrorCode(0),
|
||||
@@ -486,7 +487,7 @@ int Connection::AddSong(const string &path)
|
||||
}
|
||||
else
|
||||
if (itsErrorHandler)
|
||||
itsErrorHandler(this, MPD_ACK_ERROR_PLAYLIST_MAX, playlist_max_message, NULL);
|
||||
itsErrorHandler(this, MPD_ACK_ERROR_PLAYLIST_MAX, Message::FullPlaylist, NULL);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
@@ -627,7 +628,7 @@ bool Connection::CommitQueue()
|
||||
mpd_finishCommand(itsConnection);
|
||||
UpdateStatus();
|
||||
if (GetPlaylistLength() == itsMaxPlaylistLength && itsErrorHandler)
|
||||
itsErrorHandler(this, MPD_ACK_ERROR_PLAYLIST_MAX, playlist_max_message, NULL);
|
||||
itsErrorHandler(this, MPD_ACK_ERROR_PLAYLIST_MAX, Message::FullPlaylist, NULL);
|
||||
retval = !itsQueue.empty();
|
||||
}
|
||||
ClearQueue();
|
||||
|
||||
@@ -28,6 +28,12 @@
|
||||
|
||||
namespace MPD
|
||||
{
|
||||
namespace Message
|
||||
{
|
||||
extern const char *PartOfSongsAdded;
|
||||
extern const char *FullPlaylist;
|
||||
}
|
||||
|
||||
enum QueueCommandType { qctAdd, qctAddToPlaylist, qctDelete, qctDeleteID, qctMove, qctPlaylistMove, qctDeleteFromPlaylist };
|
||||
enum ItemType { itDirectory, itSong, itPlaylist };
|
||||
enum PlayerState { psUnknown, psStop, psPlay, psPause };
|
||||
|
||||
@@ -818,7 +818,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Song &s = myPlaylist->Main()->at(myPlaylist->Main()->Size()-list.size());
|
||||
if (s.GetHash() != list[0]->GetHash())
|
||||
ShowMessage("%s", message_part_of_songs_added);
|
||||
ShowMessage("%s", MPD::Message::PartOfSongsAdded);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1275,7 +1275,7 @@ int main(int argc, char *argv[])
|
||||
ShowMessage("Selected items added!");
|
||||
Song &s = myPlaylist->Main()->at(myPlaylist->Main()->Size()-result.size());
|
||||
if (s.GetHash() != result[0]->GetHash())
|
||||
ShowMessage("%s", message_part_of_songs_added);
|
||||
ShowMessage("%s", MPD::Message::PartOfSongsAdded);
|
||||
}
|
||||
}
|
||||
else if (id == 1)
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "window.h"
|
||||
#include "menu.h"
|
||||
#include "scrollpad.h"
|
||||
#include "misc.h"
|
||||
|
||||
#define CLEAR_FIND_HISTORY \
|
||||
do { \
|
||||
@@ -34,33 +33,9 @@
|
||||
|
||||
typedef std::pair<std::string, std::string> string_pair;
|
||||
|
||||
/*enum NcmpcppScreen
|
||||
{
|
||||
myHelp,
|
||||
myPlaylist,
|
||||
myBrowser,
|
||||
# ifdef HAVE_TAGLIB_H
|
||||
myTinyTagEditor,
|
||||
# endif // HAVE_TAGLIB_H
|
||||
myInfo,
|
||||
mySearcher,
|
||||
myLibrary,
|
||||
myLyrics,
|
||||
myPlaylistEditor,
|
||||
# ifdef HAVE_TAGLIB_H
|
||||
myTagEditor,
|
||||
# endif // HAVE_TAGLIB_H
|
||||
# ifdef ENABLE_CLOCK
|
||||
myClock,
|
||||
# endif // ENABLE_CLOCK
|
||||
csOther
|
||||
};*/
|
||||
|
||||
const int ncmpcpp_window_timeout = 500;
|
||||
|
||||
const std::string home_folder = getenv("HOME") ? getenv("HOME") : "";
|
||||
|
||||
const char * const message_part_of_songs_added = "Only part of requested songs' list added to playlist!";
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ void PlaylistEditor::AddToPlaylist(bool add_n_play)
|
||||
Mpd->PlayID(s.GetID());
|
||||
}
|
||||
else
|
||||
ShowMessage("%s", message_part_of_songs_added);
|
||||
ShowMessage("%s", MPD::Message::PartOfSongsAdded);
|
||||
}
|
||||
}
|
||||
else if (w == Content)
|
||||
|
||||
@@ -21,11 +21,13 @@
|
||||
#ifndef _SETTINGS_H
|
||||
#define _SETTINGS_H
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include "libmpdclient.h"
|
||||
#include "ncmpcpp.h"
|
||||
|
||||
const std::string config_dir = home_folder + "/.ncmpcpp/";
|
||||
const int null_key = 0x0fffffff;
|
||||
const int null_key = std::numeric_limits<int>::max();
|
||||
|
||||
struct ncmpcpp_keys
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user