includes cleaning
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#endif // HAVE_TAGLIB_H
|
#endif // HAVE_TAGLIB_H
|
||||||
|
|
||||||
using namespace MPD;
|
using namespace MPD;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
extern Connection *Mpd;
|
extern Connection *Mpd;
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_BROWSER_H
|
#ifndef _BROWSER_H
|
||||||
#define HAVE_BROWSER_H
|
#define _BROWSER_H
|
||||||
|
|
||||||
#include "mpdpp.h"
|
#include "mpdpp.h"
|
||||||
#include "ncmpcpp.h"
|
#include "ncmpcpp.h"
|
||||||
@@ -28,7 +28,7 @@ void UpdateItemList(Menu<MPD::Item> *);
|
|||||||
|
|
||||||
void DisplayItem(const MPD::Item &, void *, Menu<MPD::Item> *);
|
void DisplayItem(const MPD::Item &, void *, Menu<MPD::Item> *);
|
||||||
|
|
||||||
void GetDirectory(string, string = "/");
|
void GetDirectory(std::string, std::string = "/");
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
#include "help.h"
|
#include "help.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
|
using std::string;
|
||||||
|
|
||||||
extern MPD::Connection *Mpd;
|
extern MPD::Connection *Mpd;
|
||||||
|
|
||||||
extern ncmpcpp_keys Key;
|
extern ncmpcpp_keys Key;
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_HELP_H
|
#ifndef _HELP_H
|
||||||
#define HAVE_HELP_H
|
#define _HELP_H
|
||||||
|
|
||||||
#include "ncmpcpp.h"
|
#include "ncmpcpp.h"
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "tag_editor.h"
|
#include "tag_editor.h"
|
||||||
|
|
||||||
using namespace MPD;
|
using namespace MPD;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
extern Connection *Mpd;
|
extern Connection *Mpd;
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_HELPERS_H
|
#ifndef _HELPERS_H
|
||||||
#define HAVE_HELPERS_H
|
#define _HELPERS_H
|
||||||
|
|
||||||
#include "mpdpp.h"
|
#include "mpdpp.h"
|
||||||
#include "ncmpcpp.h"
|
#include "ncmpcpp.h"
|
||||||
@@ -31,7 +31,7 @@ void ParseArgv(int, char **);
|
|||||||
class CaseInsensitiveSorting
|
class CaseInsensitiveSorting
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool operator()(string, string);
|
bool operator()(std::string, std::string);
|
||||||
bool operator()(Song *, Song *);
|
bool operator()(Song *, Song *);
|
||||||
bool operator()(const MPD::Item &, const MPD::Item &);
|
bool operator()(const MPD::Item &, const MPD::Item &);
|
||||||
};
|
};
|
||||||
@@ -47,26 +47,26 @@ void UpdateSongList(Menu<Song> *);
|
|||||||
|
|
||||||
bool Keypressed(int, const int *);
|
bool Keypressed(int, const int *);
|
||||||
|
|
||||||
void WindowTitle(const string &);
|
void WindowTitle(const std::string &);
|
||||||
void EscapeUnallowedChars(string &);
|
void EscapeUnallowedChars(std::string &);
|
||||||
|
|
||||||
Window &operator<<(Window &, mpd_TagItems);
|
Window &operator<<(Window &, mpd_TagItems);
|
||||||
|
|
||||||
string IntoStr(mpd_TagItems);
|
std::string IntoStr(mpd_TagItems);
|
||||||
string FindSharedDir(const string &, const string &);
|
std::string FindSharedDir(const std::string &, const std::string &);
|
||||||
void DisplayTotalPlaylistLength(Window &);
|
void DisplayTotalPlaylistLength(Window &);
|
||||||
void DisplayStringPair(const StringPair &, void *, Menu<StringPair> *);
|
void DisplayStringPair(const StringPair &, void *, Menu<StringPair> *);
|
||||||
string DisplayColumns(string);
|
std::string DisplayColumns(std::string);
|
||||||
void DisplaySongInColumns(const Song &, void *, Menu<Song> *);
|
void DisplaySongInColumns(const Song &, void *, Menu<Song> *);
|
||||||
void DisplaySong(const Song &, void * = &Config.song_list_format, Menu<Song> * = NULL);
|
void DisplaySong(const Song &, void * = &Config.song_list_format, Menu<Song> * = NULL);
|
||||||
void GetInfo(Song &, Scrollpad &);
|
void GetInfo(Song &, Scrollpad &);
|
||||||
|
|
||||||
Window &Statusbar();
|
Window &Statusbar();
|
||||||
|
|
||||||
const Buffer &ShowTag(const string &);
|
const Buffer &ShowTag(const std::string &);
|
||||||
const basic_buffer<my_char_t> &ShowTagInInfoScreen(const string &);
|
const basic_buffer<my_char_t> &ShowTagInInfoScreen(const std::string &);
|
||||||
|
|
||||||
void Scroller(Window &, const string &, size_t, size_t &);
|
void Scroller(Window &, const std::string &, size_t, size_t &);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "song.h"
|
#include "song.h"
|
||||||
|
|
||||||
|
using std::vector;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
extern Window *wCurrent;
|
extern Window *wCurrent;
|
||||||
extern Scrollpad *sLyrics;
|
extern Scrollpad *sLyrics;
|
||||||
extern Scrollpad *sInfo;
|
extern Scrollpad *sInfo;
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_LYRICS_H
|
#ifndef _LYRICS_H
|
||||||
#define HAVE_LYRICS_H
|
#define _LYRICS_H
|
||||||
|
|
||||||
#include "ncmpcpp.h"
|
#include "ncmpcpp.h"
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ struct LyricsPlugin
|
|||||||
const char *url;
|
const char *url;
|
||||||
const char *tag_open;
|
const char *tag_open;
|
||||||
const char *tag_close;
|
const char *tag_close;
|
||||||
bool (*not_found)(const string &);
|
bool (*not_found)(const std::string &);
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *GetLyricsPluginName(int);
|
const char *GetLyricsPluginName(int);
|
||||||
|
|||||||
@@ -18,16 +18,12 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_MENU_H
|
#ifndef _MENU_H
|
||||||
#define HAVE_MENU_H
|
#define _MENU_H
|
||||||
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "strbuffer.h"
|
#include "strbuffer.h"
|
||||||
|
|
||||||
//include <stdexcept>
|
|
||||||
|
|
||||||
//enum Location { lLeft, lCenter, lRight };
|
|
||||||
|
|
||||||
class List
|
class List
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
/*int Abs(int num)
|
/*int Abs(int num)
|
||||||
@@ -26,17 +28,17 @@
|
|||||||
return (num < 0 ? -num : num);
|
return (num < 0 ? -num : num);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
void ToLower(string &s)
|
void ToLower(std::string &s)
|
||||||
{
|
{
|
||||||
transform(s.begin(), s.end(), s.begin(), tolower);
|
transform(s.begin(), s.end(), s.begin(), tolower);
|
||||||
}
|
}
|
||||||
|
|
||||||
int StrToInt(string str)
|
int StrToInt(std::string str)
|
||||||
{
|
{
|
||||||
return atoi(str.c_str());
|
return atoi(str.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
string IntoStr(int l)
|
std::string IntoStr(int l)
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << l;
|
ss << l;
|
||||||
|
|||||||
15
src/misc.h
15
src/misc.h
@@ -18,23 +18,18 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_MISC_H
|
#ifndef _MISC_H
|
||||||
#define HAVE_MISC_H
|
#define _MISC_H
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <sstream>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using std::string;
|
|
||||||
|
|
||||||
//int Abs(int);
|
//int Abs(int);
|
||||||
|
|
||||||
void ToLower(string &);
|
void ToLower(std::string &);
|
||||||
|
|
||||||
int StrToInt(string);
|
int StrToInt(std::string);
|
||||||
|
|
||||||
string IntoStr(int);
|
std::string IntoStr(int);
|
||||||
//string IntoStr(double, int);
|
//string IntoStr(double, int);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "mpdpp.h"
|
#include "mpdpp.h"
|
||||||
#include "ncmpcpp.h"
|
#include "ncmpcpp.h"
|
||||||
@@ -88,6 +89,10 @@
|
|||||||
|
|
||||||
using namespace MPD;
|
using namespace MPD;
|
||||||
|
|
||||||
|
using std::make_pair;
|
||||||
|
using std::string;
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
ncmpcpp_config Config;
|
ncmpcpp_config Config;
|
||||||
ncmpcpp_keys Key;
|
ncmpcpp_keys Key;
|
||||||
|
|
||||||
|
|||||||
@@ -18,16 +18,15 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_NCMPCPP_H
|
#ifndef _NCMPCPP_H
|
||||||
#define HAVE_NCMPCPP_H
|
#define _NCMPCPP_H
|
||||||
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
#include "scrollpad.h"
|
#include "scrollpad.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
typedef std::pair<string, string> StringPair;
|
typedef std::pair<std::string, std::string> StringPair;
|
||||||
using std::make_pair;
|
|
||||||
|
|
||||||
enum NcmpcppScreen
|
enum NcmpcppScreen
|
||||||
{
|
{
|
||||||
@@ -47,7 +46,7 @@ enum NcmpcppScreen
|
|||||||
|
|
||||||
const int ncmpcpp_window_timeout = 500;
|
const int ncmpcpp_window_timeout = 500;
|
||||||
|
|
||||||
const string home_folder = getenv("HOME") ? getenv("HOME") : "";
|
const std::string home_folder = getenv("HOME") ? getenv("HOME") : "";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include "scrollpad.h"
|
#include "scrollpad.h"
|
||||||
|
|
||||||
|
using std::string;
|
||||||
|
|
||||||
Scrollpad::Scrollpad(size_t startx,
|
Scrollpad::Scrollpad(size_t startx,
|
||||||
size_t starty,
|
size_t starty,
|
||||||
size_t width,
|
size_t width,
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_SCROLLPAD_H
|
#ifndef _SCROLLPAD_H
|
||||||
#define HAVE_SCROLLPAD_H
|
#define _SCROLLPAD_H
|
||||||
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "strbuffer.h"
|
#include "strbuffer.h"
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
using namespace MPD;
|
using namespace MPD;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
extern Connection *Mpd;
|
extern Connection *Mpd;
|
||||||
extern Menu<Song> *mPlaylist;
|
extern Menu<Song> *mPlaylist;
|
||||||
@@ -287,7 +288,7 @@ void Search(SearchPattern s)
|
|||||||
if (found && any_found)
|
if (found && any_found)
|
||||||
{
|
{
|
||||||
Song *ss = Config.search_in_db ? *it : new Song(**it);
|
Song *ss = Config.search_in_db ? *it : new Song(**it);
|
||||||
mSearcher->AddOption(make_pair((Buffer *)0, ss));
|
mSearcher->AddOption(std::make_pair((Buffer *)0, ss));
|
||||||
list[it-list.begin()] = 0;
|
list[it-list.begin()] = 0;
|
||||||
}
|
}
|
||||||
found = 1;
|
found = 1;
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_SEARCH_ENGINE_H
|
#ifndef _SEARCH_ENGINE_H
|
||||||
#define HAVE_SEARCH_ENGINE_H
|
#define _SEARCH_ENGINE_H
|
||||||
|
|
||||||
#include "mpdpp.h"
|
#include "mpdpp.h"
|
||||||
#include "ncmpcpp.h"
|
#include "ncmpcpp.h"
|
||||||
@@ -27,14 +27,14 @@
|
|||||||
class SearchPattern : public Song
|
class SearchPattern : public Song
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
const string &Any() { return itsAnyField; }
|
const std::string &Any() { return itsAnyField; }
|
||||||
const string &Any(const string &s) { itsAnyField = s; return itsAnyField; }
|
const std::string &Any(const std::string &s) { itsAnyField = s; return itsAnyField; }
|
||||||
|
|
||||||
void Clear() { Song::Clear(); itsAnyField.clear(); }
|
void Clear() { Song::Clear(); itsAnyField.clear(); }
|
||||||
bool Empty() { return Song::Empty() && itsAnyField.empty(); }
|
bool Empty() { return Song::Empty() && itsAnyField.empty(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
string itsAnyField;
|
std::string itsAnyField;
|
||||||
};
|
};
|
||||||
|
|
||||||
const size_t search_engine_static_options = 20;
|
const size_t search_engine_static_options = 20;
|
||||||
|
|||||||
@@ -23,11 +23,12 @@
|
|||||||
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
|
using std::ifstream;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
const string config_file = config_dir + "config";
|
const string config_file = config_dir + "config";
|
||||||
const string keys_config_file = config_dir + "keys";
|
const string keys_config_file = config_dir + "keys";
|
||||||
|
|
||||||
using std::ifstream;
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
void GetKeys(string &line, int *key)
|
void GetKeys(string &line, int *key)
|
||||||
|
|||||||
@@ -18,13 +18,13 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_SETTINGS_H
|
#ifndef _SETTINGS_H
|
||||||
#define HAVE_SETTINGS_H
|
#define _SETTINGS_H
|
||||||
|
|
||||||
#include "libmpdclient.h"
|
#include "libmpdclient.h"
|
||||||
#include "ncmpcpp.h"
|
#include "ncmpcpp.h"
|
||||||
|
|
||||||
const string config_dir = home_folder + "/.ncmpcpp/";
|
const std::string config_dir = home_folder + "/.ncmpcpp/";
|
||||||
const int null_key = 0x0fffffff;
|
const int null_key = 0x0fffffff;
|
||||||
|
|
||||||
struct ncmpcpp_keys
|
struct ncmpcpp_keys
|
||||||
@@ -96,18 +96,18 @@ struct ncmpcpp_keys
|
|||||||
|
|
||||||
struct ncmpcpp_config
|
struct ncmpcpp_config
|
||||||
{
|
{
|
||||||
string mpd_host;
|
std::string mpd_host;
|
||||||
string mpd_music_dir;
|
std::string mpd_music_dir;
|
||||||
string empty_tag;
|
std::string empty_tag;
|
||||||
string song_list_format;
|
std::string song_list_format;
|
||||||
string song_columns_list_format;
|
std::string song_columns_list_format;
|
||||||
string song_status_format;
|
std::string song_status_format;
|
||||||
string song_window_title_format;
|
std::string song_window_title_format;
|
||||||
string song_library_format;
|
std::string song_library_format;
|
||||||
string media_lib_album_format;
|
std::string media_lib_album_format;
|
||||||
string tag_editor_album_format;
|
std::string tag_editor_album_format;
|
||||||
|
|
||||||
string pattern;
|
std::string pattern;
|
||||||
|
|
||||||
Buffer browser_playlist_prefix;
|
Buffer browser_playlist_prefix;
|
||||||
Buffer selected_item_prefix;
|
Buffer selected_item_prefix;
|
||||||
@@ -170,10 +170,10 @@ void DefaultConfiguration(ncmpcpp_config &);
|
|||||||
void ReadKeys(ncmpcpp_keys &);
|
void ReadKeys(ncmpcpp_keys &);
|
||||||
void ReadConfiguration(ncmpcpp_config &);
|
void ReadConfiguration(ncmpcpp_config &);
|
||||||
|
|
||||||
Color IntoColor(const string &);
|
Color IntoColor(const std::string &);
|
||||||
string IntoStr(Color);
|
std::string IntoStr(Color);
|
||||||
mpd_TagItems IntoTagItem(char);
|
mpd_TagItems IntoTagItem(char);
|
||||||
string GetLineValue(string &, char = '"', char = '"', bool = 0);
|
std::string GetLineValue(std::string &, char = '"', char = '"', bool = 0);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,14 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#include "charset.h"
|
#include "charset.h"
|
||||||
#include "song.h"
|
#include "song.h"
|
||||||
#include "settings.h"
|
|
||||||
|
using std::string;
|
||||||
|
|
||||||
Song::Song(mpd_Song *s, bool copy_ptr) : itsSong(s ? s : mpd_newSong()),
|
Song::Song(mpd_Song *s, bool copy_ptr) : itsSong(s ? s : mpd_newSong()),
|
||||||
itsSlash(string::npos),
|
itsSlash(string::npos),
|
||||||
|
|||||||
69
src/song.h
69
src/song.h
@@ -18,63 +18,58 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_SONG_H
|
#ifndef _SONG_H
|
||||||
#define HAVE_SONG_H
|
#define _SONG_H
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
|
||||||
#include <stdexcept>
|
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "libmpdclient.h"
|
#include "libmpdclient.h"
|
||||||
|
|
||||||
using std::string;
|
|
||||||
|
|
||||||
class Song
|
class Song
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Song() : itsSlash(string::npos), itsHash(0), copyPtr(0), isStream(0), isLocalised(0) { itsSong = mpd_newSong(); }
|
Song() : itsSlash(std::string::npos), itsHash(0), copyPtr(0), isStream(0), isLocalised(0) { itsSong = mpd_newSong(); }
|
||||||
Song(mpd_Song *, bool = 0);
|
Song(mpd_Song *, bool = 0);
|
||||||
Song(const Song &);
|
Song(const Song &);
|
||||||
~Song();
|
~Song();
|
||||||
|
|
||||||
string GetFile() const;
|
std::string GetFile() const;
|
||||||
string GetName() const;
|
std::string GetName() const;
|
||||||
string GetDirectory() const;
|
std::string GetDirectory() const;
|
||||||
string GetArtist() const;
|
std::string GetArtist() const;
|
||||||
string GetTitle() const;
|
std::string GetTitle() const;
|
||||||
string GetAlbum() const;
|
std::string GetAlbum() const;
|
||||||
string GetTrack() const;
|
std::string GetTrack() const;
|
||||||
string GetYear() const;
|
std::string GetYear() const;
|
||||||
string GetGenre() const;
|
std::string GetGenre() const;
|
||||||
string GetComposer() const;
|
std::string GetComposer() const;
|
||||||
string GetPerformer() const;
|
std::string GetPerformer() const;
|
||||||
string GetDisc() const;
|
std::string GetDisc() const;
|
||||||
string GetComment() const;
|
std::string GetComment() const;
|
||||||
string GetLength() const;
|
std::string GetLength() const;
|
||||||
const long long &GetHash() const { return itsHash; }
|
const long long &GetHash() const { return itsHash; }
|
||||||
int GetTotalLength() const { return itsSong->time < 0 ? 0 : itsSong->time; }
|
int GetTotalLength() const { return itsSong->time < 0 ? 0 : itsSong->time; }
|
||||||
int GetPosition() const { return itsSong->pos; }
|
int GetPosition() const { return itsSong->pos; }
|
||||||
int GetID() const { return itsSong->id; }
|
int GetID() const { return itsSong->id; }
|
||||||
|
|
||||||
void SetFile(const string &);
|
void SetFile(const std::string &);
|
||||||
void SetArtist(const string &);
|
void SetArtist(const std::string &);
|
||||||
void SetTitle(const string &);
|
void SetTitle(const std::string &);
|
||||||
void SetAlbum(const string &);
|
void SetAlbum(const std::string &);
|
||||||
void SetTrack(const string &);
|
void SetTrack(const std::string &);
|
||||||
void SetTrack(int);
|
void SetTrack(int);
|
||||||
void SetYear(const string &);
|
void SetYear(const std::string &);
|
||||||
void SetYear(int);
|
void SetYear(int);
|
||||||
void SetGenre(const string &);
|
void SetGenre(const std::string &);
|
||||||
void SetComposer(const string &);
|
void SetComposer(const std::string &);
|
||||||
void SetPerformer(const string &);
|
void SetPerformer(const std::string &);
|
||||||
void SetDisc(const string &);
|
void SetDisc(const std::string &);
|
||||||
void SetComment(const string &);
|
void SetComment(const std::string &);
|
||||||
void SetPosition(int);
|
void SetPosition(int);
|
||||||
|
|
||||||
void SetNewName(const string &name) { itsNewName = name == GetName() ? "" : name; }
|
void SetNewName(const std::string &name) { itsNewName = name == GetName() ? "" : name; }
|
||||||
string GetNewName() const { return itsNewName; }
|
std::string GetNewName() const { return itsNewName; }
|
||||||
|
|
||||||
std::string toString(const std::string &) const;
|
std::string toString(const std::string &) const;
|
||||||
|
|
||||||
@@ -95,12 +90,12 @@ class Song
|
|||||||
bool operator!=(const Song &) const;
|
bool operator!=(const Song &) const;
|
||||||
bool operator<(const Song &rhs) const;
|
bool operator<(const Song &rhs) const;
|
||||||
|
|
||||||
static string ShowTime(int);
|
static std::string ShowTime(int);
|
||||||
private:
|
private:
|
||||||
void __Count_Last_Slash_Position();
|
void __Count_Last_Slash_Position();
|
||||||
|
|
||||||
mpd_Song *itsSong;
|
mpd_Song *itsSong;
|
||||||
string itsNewName;
|
std::string itsNewName;
|
||||||
size_t itsSlash;
|
size_t itsSlash;
|
||||||
long long itsHash;
|
long long itsHash;
|
||||||
bool copyPtr;
|
bool copyPtr;
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "browser.h"
|
#include "browser.h"
|
||||||
#include "charset.h"
|
#include "charset.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
@@ -26,6 +28,7 @@
|
|||||||
#include "status_checker.h"
|
#include "status_checker.h"
|
||||||
|
|
||||||
using namespace MPD;
|
using namespace MPD;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
extern Connection *Mpd;
|
extern Connection *Mpd;
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_STATUS_CHECKER_H
|
#ifndef _STATUS_CHECKER_H
|
||||||
#define HAVE_STATUS_CHECKER_H
|
#define _STATUS_CHECKER_H
|
||||||
|
|
||||||
#include "mpdpp.h"
|
#include "mpdpp.h"
|
||||||
#include "ncmpcpp.h"
|
#include "ncmpcpp.h"
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#ifdef HAVE_TAGLIB_H
|
#ifdef HAVE_TAGLIB_H
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "id3v2tag.h"
|
#include "id3v2tag.h"
|
||||||
#include "textidentificationframe.h"
|
#include "textidentificationframe.h"
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
#ifdef HAVE_TAGLIB_H
|
#ifdef HAVE_TAGLIB_H
|
||||||
|
|
||||||
#ifndef HAVE_TAG_EDITOR_H
|
#ifndef _TAG_EDITOR_H
|
||||||
#define HAVE_TAG_EDITOR_H
|
#define _TAG_EDITOR_H
|
||||||
|
|
||||||
// taglib headers
|
// taglib headers
|
||||||
#include "fileref.h"
|
#include "fileref.h"
|
||||||
@@ -32,11 +32,11 @@
|
|||||||
#include "mpdpp.h"
|
#include "mpdpp.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
typedef void (Song::*SongSetFunction)(const string &);
|
typedef void (Song::*SongSetFunction)(const std::string &);
|
||||||
typedef string (Song::*SongGetFunction)() const;
|
typedef std::string (Song::*SongGetFunction)() const;
|
||||||
|
|
||||||
string FindSharedDir(Menu<Song> *);
|
std::string FindSharedDir(Menu<Song> *);
|
||||||
string FindSharedDir(const MPD::SongList &);
|
std::string FindSharedDir(const MPD::SongList &);
|
||||||
void DisplayTag(const Song &, void *, Menu<Song> *);
|
void DisplayTag(const Song &, void *, Menu<Song> *);
|
||||||
|
|
||||||
SongSetFunction IntoSetFunction(mpd_TagItems);
|
SongSetFunction IntoSetFunction(mpd_TagItems);
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
|
using std::string;
|
||||||
|
using std::wstring;
|
||||||
|
|
||||||
void InitScreen(bool enable_colors)
|
void InitScreen(bool enable_colors)
|
||||||
{
|
{
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
|||||||
16
src/window.h
16
src/window.h
@@ -18,8 +18,8 @@
|
|||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef HAVE_WINDOW_H
|
#ifndef _WINDOW_H
|
||||||
#define HAVE_WINDOW_H
|
#define _WINDOW_H
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@@ -47,10 +47,6 @@
|
|||||||
# define TO_WSTRING(x) x
|
# define TO_WSTRING(x) x
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using std::string;
|
|
||||||
using std::wstring;
|
|
||||||
using std::vector;
|
|
||||||
|
|
||||||
enum Color { clDefault, clBlack, clRed, clGreen, clYellow, clBlue, clMagenta, clCyan, clWhite, clEnd };
|
enum Color { clDefault, clBlack, clRed, clGreen, clYellow, clBlue, clMagenta, clCyan, clWhite, clEnd };
|
||||||
enum Format { fmtNone = 100, fmtBold, fmtBoldEnd, fmtReverse, fmtReverseEnd, fmtAltCharset, fmtAltCharsetEnd };
|
enum Format { fmtNone = 100, fmtBold, fmtBoldEnd, fmtReverse, fmtReverseEnd, fmtAltCharset, fmtAltCharsetEnd };
|
||||||
enum Border { brNone, brBlack, brRed, brGreen, brYellow, brBlue, brMagenta, brCyan, brWhite };
|
enum Border { brNone, brBlack, brRed, brGreen, brYellow, brBlue, brMagenta, brCyan, brWhite };
|
||||||
@@ -98,7 +94,7 @@ class Window
|
|||||||
Color GetColor() const;
|
Color GetColor() const;
|
||||||
Border GetBorder() const;
|
Border GetBorder() const;
|
||||||
std::string GetString(const std::string &, size_t = -1, size_t = 0, bool = 0) const;
|
std::string GetString(const std::string &, size_t = -1, size_t = 0, bool = 0) const;
|
||||||
string GetString(size_t length = -1, size_t width = 0, bool encrypted = 0) const { return GetString("", length, width, encrypted); }
|
std::string GetString(size_t length = -1, size_t width = 0, bool encrypted = 0) const { return GetString("", length, width, encrypted); }
|
||||||
void GetXY(int &, int &);
|
void GetXY(int &, int &);
|
||||||
void GotoXY(int, int);
|
void GotoXY(int, int);
|
||||||
const int &X() const;
|
const int &X() const;
|
||||||
@@ -109,7 +105,7 @@ class Window
|
|||||||
void SetBaseColor(Color, Color = clDefault);
|
void SetBaseColor(Color, Color = clDefault);
|
||||||
void SetBorder(Border);
|
void SetBorder(Border);
|
||||||
void SetTimeout(int);
|
void SetTimeout(int);
|
||||||
void SetTitle(const string &);
|
void SetTitle(const std::string &);
|
||||||
|
|
||||||
void Hide(char = 32) const;
|
void Hide(char = 32) const;
|
||||||
void Bold(bool) const;
|
void Bold(bool) const;
|
||||||
@@ -150,7 +146,7 @@ class Window
|
|||||||
virtual Window *Clone() const { return new Window(*this); }
|
virtual Window *Clone() const { return new Window(*this); }
|
||||||
virtual Window *EmptyClone() const;
|
virtual Window *EmptyClone() const;
|
||||||
|
|
||||||
static size_t Length(const wstring &);
|
static size_t Length(const std::wstring &);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@@ -173,7 +169,7 @@ class Window
|
|||||||
int itsX;
|
int itsX;
|
||||||
int itsY;
|
int itsY;
|
||||||
|
|
||||||
string itsTitle;
|
std::string itsTitle;
|
||||||
std::stack<Colors> itsColors;
|
std::stack<Colors> itsColors;
|
||||||
|
|
||||||
Color itsColor;
|
Color itsColor;
|
||||||
|
|||||||
Reference in New Issue
Block a user