get rid of some externs
This commit is contained in:
@@ -34,8 +34,6 @@ namespace Display
|
|||||||
*menu << t;
|
*menu << t;
|
||||||
}
|
}
|
||||||
|
|
||||||
//void TotalPlaylistLength(Window &);
|
|
||||||
|
|
||||||
void StringPairs(const string_pair &, void *, Menu<string_pair> *);
|
void StringPairs(const string_pair &, void *, Menu<string_pair> *);
|
||||||
|
|
||||||
void SongsInColumns(const MPD::Song &, void *, Menu<MPD::Song> *);
|
void SongsInColumns(const MPD::Song &, void *, Menu<MPD::Song> *);
|
||||||
@@ -51,16 +49,5 @@ namespace Display
|
|||||||
void Clock(Window &, const tm *);
|
void Clock(Window &, const tm *);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Refresh
|
|
||||||
{
|
|
||||||
void MediaLibrary();
|
|
||||||
|
|
||||||
void PlaylistEditor();
|
|
||||||
|
|
||||||
# ifdef HAVE_TAGLIB_H
|
|
||||||
void TagEditor();
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace Global
|
|||||||
extern MPD::Connection *Mpd;
|
extern MPD::Connection *Mpd;
|
||||||
|
|
||||||
// extern int now_playing;
|
// extern int now_playing;
|
||||||
extern int lock_statusbar_delay;
|
// extern int lock_statusbar_delay;
|
||||||
|
|
||||||
// extern size_t browsed_dir_scroll_begin;
|
// extern size_t browsed_dir_scroll_begin;
|
||||||
extern size_t main_start_y;
|
extern size_t main_start_y;
|
||||||
@@ -79,8 +79,8 @@ namespace Global
|
|||||||
extern time_t timer;
|
extern time_t timer;
|
||||||
|
|
||||||
// extern std::string browsed_dir;
|
// extern std::string browsed_dir;
|
||||||
extern std::string editor_browsed_dir;
|
// extern std::string editor_browsed_dir;
|
||||||
extern std::string editor_highlighted_dir;
|
// extern std::string editor_highlighted_dir;
|
||||||
// extern std::string info_title;
|
// extern std::string info_title;
|
||||||
|
|
||||||
// extern BasicScreen myScreen;
|
// extern BasicScreen myScreen;
|
||||||
@@ -102,8 +102,6 @@ namespace Global
|
|||||||
extern std::string volume_state;
|
extern std::string volume_state;
|
||||||
|
|
||||||
extern bool header_update_status;
|
extern bool header_update_status;
|
||||||
|
|
||||||
extern bool header_update_status;
|
|
||||||
// extern bool search_case_sensitive;
|
// extern bool search_case_sensitive;
|
||||||
// extern bool search_match_to_pattern;
|
// extern bool search_match_to_pattern;
|
||||||
|
|
||||||
|
|||||||
@@ -68,15 +68,13 @@ Window *Global::wFooter;
|
|||||||
|
|
||||||
Connection *Global::Mpd;
|
Connection *Global::Mpd;
|
||||||
|
|
||||||
int Global::lock_statusbar_delay = -1;
|
|
||||||
|
|
||||||
size_t Global::main_start_y;
|
size_t Global::main_start_y;
|
||||||
size_t Global::main_height;
|
size_t Global::main_height;
|
||||||
|
|
||||||
time_t Global::timer;
|
time_t Global::timer;
|
||||||
|
|
||||||
string Global::editor_browsed_dir = "/";
|
//string Global::myTagEditor->CurrentDir() = "/";
|
||||||
string Global::editor_highlighted_dir;
|
//string Global::editor_highlighted_dir;
|
||||||
|
|
||||||
bool Global::dont_change_now_playing = 0;
|
bool Global::dont_change_now_playing = 0;
|
||||||
bool Global::block_progressbar_update = 0;
|
bool Global::block_progressbar_update = 0;
|
||||||
@@ -947,7 +945,7 @@ int main(int argc, char *argv[])
|
|||||||
Mpd->UpdateDirectory(myBrowser->CurrentDir());
|
Mpd->UpdateDirectory(myBrowser->CurrentDir());
|
||||||
# ifdef HAVE_TAGLIB_H
|
# ifdef HAVE_TAGLIB_H
|
||||||
else if (myScreen == myTagEditor && !Config.albums_in_tag_editor)
|
else if (myScreen == myTagEditor && !Config.albums_in_tag_editor)
|
||||||
Mpd->UpdateDirectory(editor_browsed_dir);
|
Mpd->UpdateDirectory(myTagEditor->CurrentDir());
|
||||||
# endif // HAVE_TAGLIB_H
|
# endif // HAVE_TAGLIB_H
|
||||||
else
|
else
|
||||||
Mpd->UpdateDirectory("/");
|
Mpd->UpdateDirectory("/");
|
||||||
@@ -1083,11 +1081,11 @@ int main(int argc, char *argv[])
|
|||||||
UnlockStatusbar();
|
UnlockStatusbar();
|
||||||
if (!new_dir.empty() && new_dir != old_dir)
|
if (!new_dir.empty() && new_dir != old_dir)
|
||||||
{
|
{
|
||||||
string full_old_dir = Config.mpd_music_dir + editor_browsed_dir + "/" + locale_to_utf_cpy(old_dir);
|
string full_old_dir = Config.mpd_music_dir + myTagEditor->CurrentDir() + "/" + locale_to_utf_cpy(old_dir);
|
||||||
string full_new_dir = Config.mpd_music_dir + editor_browsed_dir + "/" + locale_to_utf_cpy(new_dir);
|
string full_new_dir = Config.mpd_music_dir + myTagEditor->CurrentDir() + "/" + locale_to_utf_cpy(new_dir);
|
||||||
if (rename(full_old_dir.c_str(), full_new_dir.c_str()) == 0)
|
if (rename(full_old_dir.c_str(), full_new_dir.c_str()) == 0)
|
||||||
{
|
{
|
||||||
Mpd->UpdateDirectory(editor_browsed_dir);
|
Mpd->UpdateDirectory(myTagEditor->CurrentDir());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include "mpdpp.h"
|
#include "mpdpp.h"
|
||||||
#include "ncmpcpp.h"
|
#include "ncmpcpp.h"
|
||||||
|
|
||||||
class SearchEngine : public Screen < Menu< std::pair<Buffer *, MPD::Song *> > >
|
class SearchEngine : public Screen< Menu< std::pair<Buffer *, MPD::Song *> > >
|
||||||
{
|
{
|
||||||
class SearchPattern : public MPD::Song
|
class SearchPattern : public MPD::Song
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ namespace
|
|||||||
{
|
{
|
||||||
time_t time_of_statusbar_lock;
|
time_t time_of_statusbar_lock;
|
||||||
|
|
||||||
|
int lock_statusbar_delay = -1;
|
||||||
|
|
||||||
string switch_state;
|
string switch_state;
|
||||||
|
|
||||||
bool block_statusbar_update = 0;
|
bool block_statusbar_update = 0;
|
||||||
|
|||||||
@@ -437,12 +437,12 @@ void TagEditor::Update()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int highlightme = -1;
|
int highlightme = -1;
|
||||||
Mpd->GetDirectories(editor_browsed_dir, list);
|
Mpd->GetDirectories(itsBrowsedDir, list);
|
||||||
sort(list.begin(), list.end(), CaseInsensitiveSorting());
|
sort(list.begin(), list.end(), CaseInsensitiveSorting());
|
||||||
if (editor_browsed_dir != "/")
|
if (itsBrowsedDir != "/")
|
||||||
{
|
{
|
||||||
size_t slash = editor_browsed_dir.rfind("/");
|
size_t slash = itsBrowsedDir.rfind("/");
|
||||||
string parent = slash != string::npos ? editor_browsed_dir.substr(0, slash) : "/";
|
string parent = slash != string::npos ? itsBrowsedDir.substr(0, slash) : "/";
|
||||||
Dirs->AddOption(make_pair("[..]", parent));
|
Dirs->AddOption(make_pair("[..]", parent));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -455,7 +455,7 @@ void TagEditor::Update()
|
|||||||
string to_display = slash != string::npos ? it->substr(slash+1) : *it;
|
string to_display = slash != string::npos ? it->substr(slash+1) : *it;
|
||||||
utf_to_locale(to_display);
|
utf_to_locale(to_display);
|
||||||
Dirs->AddOption(make_pair(to_display, *it));
|
Dirs->AddOption(make_pair(to_display, *it));
|
||||||
if (*it == editor_highlighted_dir)
|
if (*it == itsHighlightedDir)
|
||||||
highlightme = Dirs->Size()-1;
|
highlightme = Dirs->Size()-1;
|
||||||
}
|
}
|
||||||
if (highlightme != -1)
|
if (highlightme != -1)
|
||||||
@@ -513,8 +513,8 @@ void TagEditor::EnterPressed()
|
|||||||
Mpd->GetDirectories(LeftColumn->Current().second, test);
|
Mpd->GetDirectories(LeftColumn->Current().second, test);
|
||||||
if (!test.empty())
|
if (!test.empty())
|
||||||
{
|
{
|
||||||
editor_highlighted_dir = editor_browsed_dir;
|
itsHighlightedDir = itsBrowsedDir;
|
||||||
editor_browsed_dir = LeftColumn->Current().second;
|
itsBrowsedDir = LeftColumn->Current().second;
|
||||||
LeftColumn->Clear(0);
|
LeftColumn->Clear(0);
|
||||||
LeftColumn->Reset();
|
LeftColumn->Reset();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ class TagEditor : public Screen<Window>
|
|||||||
Menu<std::string> *TagTypes;
|
Menu<std::string> *TagTypes;
|
||||||
Menu<MPD::Song> *Tags;
|
Menu<MPD::Song> *Tags;
|
||||||
|
|
||||||
|
const std::string &CurrentDir() { return itsBrowsedDir; }
|
||||||
|
|
||||||
static void ReadTags(mpd_Song *);
|
static void ReadTags(mpd_Song *);
|
||||||
static bool WriteTags(MPD::Song &);
|
static bool WriteTags(MPD::Song &);
|
||||||
|
|
||||||
@@ -87,6 +89,9 @@ class TagEditor : public Screen<Window>
|
|||||||
static void CapitalizeFirstLetters(MPD::Song &);
|
static void CapitalizeFirstLetters(MPD::Song &);
|
||||||
static void LowerAllLetters(MPD::Song &);
|
static void LowerAllLetters(MPD::Song &);
|
||||||
|
|
||||||
|
std::string itsBrowsedDir;
|
||||||
|
std::string itsHighlightedDir;
|
||||||
|
|
||||||
static const size_t MiddleColumnWidth;
|
static const size_t MiddleColumnWidth;
|
||||||
static size_t LeftColumnWidth;
|
static size_t LeftColumnWidth;
|
||||||
static size_t MiddleColumnStartX;
|
static size_t MiddleColumnStartX;
|
||||||
|
|||||||
Reference in New Issue
Block a user