diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/Library/ml_wire/Wire.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Plugins/Library/ml_wire/Wire.h')
-rw-r--r-- | Src/Plugins/Library/ml_wire/Wire.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Src/Plugins/Library/ml_wire/Wire.h b/Src/Plugins/Library/ml_wire/Wire.h new file mode 100644 index 00000000..8049be62 --- /dev/null +++ b/Src/Plugins/Library/ml_wire/Wire.h @@ -0,0 +1,62 @@ +#ifndef NULLSOFT_WIREH +#define NULLSOFT_WIREH + +#include "Feeds.h" +#include "../nu/AutoLock.h" +#include "api_podcasts.h" +#include <vector> + +class ChannelList : public api_podcasts +{ +public: + + ChannelList() : channelGuard( "Feed Guard" ) {} + + typedef std::vector<Channel> ChannelContainer; + typedef ChannelContainer::iterator iterator; + + size_t size() { return channelList.size(); } + bool empty() { return channelList.empty(); } + + void push_back( const Channel &channel ); + bool AddChannel( Channel &channel ); + + iterator begin() { return channelList.begin(); } + + iterator end() { return channelList.end(); } + + void RemoveChannel( int index ) { channelList.erase( channelList.begin() + index ); } + + Channel &operator[]( size_t index ) { return channelList[ index ]; } + + ChannelContainer channelList; + + operator Nullsoft::Utility::LockGuard &( ) { return channelGuard; } + + void SortByTitle(); + + Nullsoft::Utility::LockGuard channelGuard; + +public: // api_podcasts interface + size_t GetNumPodcasts(); + ifc_podcast *EnumPodcast( size_t i ); + +protected: + RECVS_DISPATCH; +}; + +extern ChannelList channels; +//extern CategoryIndex sourceByCategory; +#include "ChannelSync.h" + +class WireManager : public ChannelSync +{ +public: + void BeginChannelSync(); + void NewChannel( const Channel &newChannel ); + void EndChannelSync(); +}; + +extern WireManager channelMgr; + +#endif
\ No newline at end of file |