📄 channel.h
字号:
/* * Copyright (C) 2005-2007 gulikoza * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//* $Id$ */#ifndef CHANNEL_H#define CHANNEL_H#define MAX_CHANNELS 500#include "log.h"#define MODULE "Channel"// delay to change channels#define SWITCHDELAY 800extern void ProcessEvents();class Channel {private: unsigned short last; unsigned short current; unsigned short num; Source * source; struct { char type; CStr name; CStr location; } channels[MAX_CHANNELS];public: Channel():last(0),current(0),num(0),source(NULL) { } int Open(CStr&); bool Close(); bool OpenFile(CStr&); bool SetChannel(unsigned int); void ToggleRecord(); bool LastChannel() { return SetChannel(last); } bool NextChannel() { if(current == num) return SetChannel(1); else return SetChannel(current + 1); } bool PreviousChannel() { if(current == 1) return SetChannel(num); else return SetChannel(current - 1); } CStr GetName(int n = -1) { CStr ret; if(n < 0) ret = channels[current-1].name; else if(n < num) ret = channels[n].name; return ret; } unsigned int GetNum(bool all = false) { if(all) return num; return current; } ~Channel() { current = 0; Close(); }};#undef MODULE#ifdef DEBUG#undef DEBUG#endif#endif // CHANNEL_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -