forked from Paremo/foo_bbookmark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbookmark_automatic.h
More file actions
115 lines (83 loc) · 2.23 KB
/
bookmark_automatic.h
File metadata and controls
115 lines (83 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#pragma once
#include "bookmark_types.h"
#include "bookmark_preferences.h"
#include <vector>
#include <list>
#include <sstream>
#include <iomanip>
namespace dlg {
class CListControlBookmark;
}
class bookmark_automatic {
public:
bookmark_automatic() {
//..
};
~bookmark_automatic() {
//..
}
bool checkDummy() {
return (bool)dummy.desc.get_length();
}
const bookmark_t getDummy() {
return dummy;
}
bool getDyna() {
return dummy.isRadio() && dummy.dyna;
}
void setDyna(bool state) {
dummy.dyna = dummy.isRadio() && state;
}
bool checkDummyIsRadio() {
return (bool)dummy.isRadio();
}
bool checkDummyIsRadio(const pfc::string8 path) {
return (bool)dummy.isRadio(path);
}
bool fetchHelloRadioStationName(pfc::string8 &out);
bool CheckAutoFilter();
void updateDummyTime();
void updateDummy();
bool upgradeDummy(std::list< dlg::CListControlBookmark*> guiList);
void ResetRestoredDummy();
void ResetRestoredDummyTime();
void SetRestoredDummy(bookmark_t& bm);
void checkDeletedRestoredDummy(const bit_array& mask, size_t count);
void resetDummyKeepDyna() {
auto tmp = dummy;
resetDummyAll();
dummy.dyna = tmp.dyna;
dummy.desc = tmp.desc;
dummy.comment = tmp.comment;
}
void resetDummyLocChecks() {
dummy.need_loc_retries = 0;
dummy.need_playlist = true;
}
void resetDummyAll() { dummy.reset(); }
void setDummyTime(double time) { dummy.set_time(time); }
bool isRestoredDummy(const bookmark_t& bm);
bool isRestoredRadioDummy(const bookmark_t& bm);
void refresh_ui(bool bselect, bool bensure_visible, const std::vector<bookmark_t>& masterList, std::list< dlg::CListControlBookmark*> guiLists);
private:
bookmark_t dummy;
bookmark_t restored_dummy;
bool m_updatePlaylist = true;
titleformat_object::ptr m_pttf_title = nullptr;
};
#pragma warning( push )
#pragma warning( disable:4996 )
inline void gimme_date(bookmark_t& out) {
pfc::string8 date;
pfc::string8 runtime_date;
auto t = std::time(nullptr);
auto tm = *std::localtime(&t);
auto sctime = asctime(&tm);
date.set_string(sctime);
date.truncate_last_char();
char buffer[DATE_BUFFER_SIZE];
std::strftime(buffer, DATE_BUFFER_SIZE, cfg_date_format.get(), &tm);
out.runtime_date = buffer;
out.date = date;
}
#pragma warning( pop )