3 * Copyright (C) 2005-2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
24 #include "MythSession.h"
25 #include "XBDateTime.h"
26 #include "video/VideoInfoTag.h"
30 #include "cmyth/include/cmyth/cmyth.h"
43 , private CMythSession::IEventListener
48 virtual bool Open(const CURL& url);
49 virtual int64_t Seek(int64_t pos, int whence=SEEK_SET);
50 virtual int64_t GetPosition();
51 virtual int64_t GetLength();
52 virtual int Stat(const CURL& url, struct __stat64* buffer) { return -1; }
54 virtual unsigned int Read(void* buffer, int64_t size);
55 virtual CStdString GetContent() { return ""; }
56 virtual bool SkipNext();
58 virtual bool Delete(const CURL& url);
59 virtual bool Exists(const CURL& url);
60 virtual int GetChunkSize() {return 1;};
62 virtual ILiveTVInterface* GetLiveTV() {return (ILiveTVInterface*)this;}
64 virtual bool NextChannel(bool preview = false);
65 virtual bool PrevChannel(bool preview = false);
66 virtual bool SelectChannel(unsigned int channel);
68 virtual int GetTotalTime();
69 virtual int GetStartTime();
71 virtual bool UpdateItem(CFileItem& item);
73 virtual IRecordable* GetRecordable() {return (IRecordable*)this;}
75 virtual bool CanRecord();
76 virtual bool IsRecording();
77 virtual bool Record(bool bOnOff);
79 virtual bool GetCommBreakList(cmyth_commbreaklist_t& commbreaklist);
80 virtual bool GetCutList(cmyth_commbreaklist_t& commbreaklist);
82 virtual int IoControl(EIoControl request, void* param);
84 virtual void OnEvent(int event, const std::string& data);
87 bool ChangeChannel(int direction, const CStdString &channel);
89 bool SetupConnection(const CURL& url, bool control, bool event, bool database);
90 bool SetupRecording(const CURL& url);
91 bool SetupLiveTV(const CURL& url);
92 bool SetupFile(const CURL& url);
94 CStdString GetValue(char* str) { return m_session->GetValue(str); }
95 CDateTime GetValue(const cmyth_timestamp_t t) { return m_session->GetValue(t); }
97 CMythSession* m_session;
99 cmyth_conn_t m_control;
100 cmyth_database_t m_database;
101 cmyth_recorder_t m_recorder;
102 cmyth_proginfo_t m_program;
104 CStdString m_filename;
105 CVideoInfoTag m_infotag;
107 CCriticalSection m_section;
108 std::queue<std::pair<int, std::string> > m_events;
112 unsigned int m_timestamp;