2 Copyright 2004-2007 Chris Tallon, Marten Richter
4 This file is part of VOMP.
6 VOMP 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 of the License, or
9 (at your option) any later version.
11 VOMP 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 VOMP. If not, see <https://www.gnu.org/licenses/>.
20 #include "wwinvideoh264filter.h"
26 WWinVideoH264Filter::WWinVideoH264Filter()
30 sl.setShowSelOption(false);
31 sl.setPosition(15,30+15);
34 WWinVideoH264Filter::~WWinVideoH264Filter()
39 void WWinVideoH264Filter::initSelectList(bool startup)
45 selection=sl.getCurrentOption();
46 top=sl.getTopOption();
52 VideoWin *vw=(VideoWin*) Video::getInstance();
54 const VideoFilterDescList *list=vw->getVideoH264FilterList(filselected);
55 for (i = 0; i < list->size();i++)
57 const char * name = (*list)[i].friendlyname;
60 char * desc=new char [strlen(name)+1];
62 sl.addOption(desc,i,0);
68 sl.hintSetCurrent(selection);
73 void WWinVideoH264Filter::setSize(UINT w, UINT h)
76 sl.setSize(area.w - 240, area.h - 30-15-30);
79 void WWinVideoH264Filter::draw()
83 drawText(tr("Selected Filter:"), 15, 15, DrawStyle::LIGHTTEXT);
85 VideoWin *vw=(VideoWin*) Video::getInstance();
86 const VideoFilterDescList *list=vw->getVideoH264FilterList(filselected);
87 if (filselected!=-1) drawText((*list)[filselected].friendlyname,215,15,DrawStyle::LIGHTTEXT);
90 if (!(*list)[sl.getCurrentOptionData()].vmr9tested)
92 rectangle(area.w - 220, 160, 200, 20, DrawStyle::YELLOW);
93 drawText(tr("VMR 9 support: ?"), area.w - 220, 160, DrawStyle::DARKTEXT);
95 else if ((*list)[sl.getCurrentOptionData()].vmr9)
97 rectangle(area.w - 220, 160, 200, 20, DrawStyle::GREEN);
98 drawText(tr("VMR 9 support: yes"), area.w - 220, 160, DrawStyle::DARKTEXT);
102 rectangle(area.w - 220, 160, 200, 20, DrawStyle::RED);
103 drawText(tr("VMR 9 support: no"), area.w - 220, 160, DrawStyle::DARKTEXT);
106 drawText(tr("Press [ok] to select filter! "), 15, area.h - 30, DrawStyle::LIGHTTEXT);
110 bool WWinVideoH264Filter::mouseLBDOWN(int x, int y)
112 if (sl.mouseLBDOWN(x,y))
114 BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press
120 bool WWinVideoH264Filter::mouseMove(int x, int y)
122 if (sl.mouseMove(x,y))
124 sl.setShowSelOption(true);
132 void WWinVideoH264Filter::processMessage(Message* m)
134 Log::getInstance()->log("VRecordingList", Log::DEBUG, "Got message value %lu", m->message);
136 if (m->message == Message::MOUSE_MOVE)
138 if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
140 sl.setShowSelOption(true);
143 viewman->updateView(this);
146 else if (m->message == Message::MOUSE_LBDOWN)
148 if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
150 ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press
154 //check if press is outside this view! then simulate cancel
155 int x=(m->parameter>>16)-getScreenX();
156 int y=(m->parameter&0xFFFF)-getScreenY();
157 if (x<0 || y <0 || x>getWidth() || y>getHeight())
159 ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press
167 void WWinVideoH264Filter::doSave()
169 Message* m = new Message();
170 m->message = Message::CHANGED_DEVICEOPTIONS;
173 //Command::getInstance()->postMessage(m);
178 int WWinVideoH264Filter::handleCommand(int command)
185 if (sl.getCurrentOption() != 0)
188 sl.setShowSelOption(true);
193 sl.setShowSelOption(false);
194 return 4; //Control to vopts control
200 sl.setShowSelOption(true);
203 case Input::SKIPBACK:
208 case Input::SKIPFORWARD:
215 VideoWin*vw=(VideoWin*)Video::getInstance();
216 vw->selectVideoH264Filter(sl.getCurrentOptionData());