along with VOMP; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
#ifndef BITMAP_H
#define BITMAP_H
#include "defines.h"
#include <vector>
-class DisplayRegion {
-public:
- DisplayRegion();
- UINT windowx, windowy,windoww,windowh;
+class DisplayRegion
+{
+ public:
+ DisplayRegion();
+ UINT windowx, windowy, windoww, windowh;
UINT framewidth,frameheight;
};
-
-
class Palette
{
public:
UCHAR getBpp() const { return bpp; }
void reset() { numColours = 0; }
void setBpp(UCHAR tBpp);
- ULONG getColour(UCHAR index) const {
- return index < maxColours ? colour[index] : 0; }
+ ULONG getColour(UCHAR index) const { return index < maxColours ? colour[index] : 0; }
void setColour(UCHAR index, ULONG tColour);
void setYCrCbA(UCHAR index, UCHAR tY, UCHAR tCr, UCHAR tCb, UCHAR tA);
const std::vector<ULONG>& getColourVector() const { return colour; }
const std::vector<UCHAR>& getCrVector() const { return Cr; }
const std::vector<UCHAR>& getCbVector() const { return Cb; }
const std::vector<UCHAR>& getAVector() const { return A; }
- const UINT getNumColours()const{return numColours;};
+ UINT getNumColours() const { return numColours; }
private:
const static UINT MAX_DEPTH = 8;
std::vector<ULONG> colour;
void setAllIndices(UCHAR index);
};
-
#endif
InputMan::getInstance()->changePowerState(false);
isStandby = true;
Sleeptimer::getInstance()->shutdown();
-#ifdef WIN32
- stop(); //different behavoiur on windows, we exit // FIXME - stop() now called directly from winmain
-#endif
}
}
void Command::clearMQInputEvents()
{
- // FIXME implement this
+ std::lock_guard<std::mutex> lg(messageQueueMutex); // Get the lock
+
+ MQueueI i = messages.begin();
+ while(i != messages.end())
+ {
+ Message* m = *i;
+ if (m->message == Message::INPUT_EVENT)
+ {
+ delete m;
+ i = messages.erase(i);
+ }
+ else
+ {
+ ++i;
+ }
+ }
}
void Command::doReboot()
}
}
-void Input::setHWCtoCommand(ULLONG hcw, UCHAR command)
+void Input::setHWCtoCommand(HWC_TYPE hcw, UCHAR command)
{
translist[hcw] = command;
}
-void Input::unsetHWC(ULLONG hcw) // FIXME never used
+void Input::unsetHWC(HWC_TYPE hcw) // FIXME never used
{
translist.erase(hcw);
}
class VDR;
-typedef std::map<ULLONG, UCHAR> RemoteTranslationList;
+typedef std::map<HWC_TYPE, UCHAR> RemoteTranslationList;
class Input: public AbstractOption
{
#include "inputcec.h"
#endif
#include "inputudp.h"
+#ifdef WIN32
#include "inputwin.h"
+#endif
#include "i18n.h"
#include "input.h"
SetEvent(event);
}
*/
-
-void InputWin::SendPower()
-{
- /*
- curevent=POWER;
- hascurevent=true;
- SetEvent(event);
- */
- sendInputKey(POWER);
-}
int ReceiveButtonCH(UINT button); //Windows Message from WND_PROC (char)
int ReceiveButtonAP(UINT button); // (App command)
int ReceiveButtonRI(UINT button); // (Remote control)
- void SendPower();
void InitHWCListwithDefaults();
const char* getHardCodedHardwareKeyNameForVompKey(UCHAR vompKey);
std::string getHardwareKeyName(HWC_TYPE hardwareKey);
initted = 1;
logLevel = startLogLevel;
enabled = tenabled;
- logfile = fopen(fileName, "a");
+ //logfile = fopen(fileName, "a");
// logfile = fopen(stdout, "a");
- //logfile = stdout;
+ logfile = stdout;
// logfile = fopen("/log", "a");
if (logfile) return 1;
class Message;
typedef std::deque<Message*> MQueue;
+typedef std::deque<Message*>::iterator MQueueI;
class MessageQueue
{
}
}
}
+ FALLTHROUGH // keep compiler happy (all posibilities return)
case S_PAUSE_P: // from S_PAUSE_P -----------------------------------
{
switch(toState)
}
}
}
+ FALLTHROUGH // keep compiler happy (all posibilities return)
case S_PAUSE_I: // from S_PAUSE_I -----------------------------------
{
switch(toState)
}
}
}
+ FALLTHROUGH // keep compiler happy (all posibilities return)
case S_FFWD: // from S_FFWD -----------------------------------
{
switch(toState)
case S_PLAY: // to S_PLAY
{
state = S_PLAY;
- ULONG stepback = (ULONG)(((double)USER_RESPONSE_TIME * ifactor) * fps / 1000.);
+ ULONG stepback = static_cast<ULONG>(USER_RESPONSE_TIME * ifactor * fps / 1000);
if (stepback < currentFrameNumber)
currentFrameNumber -= stepback;
else
}
}
}
+ FALLTHROUGH // keep compiler happy (all posibilities return)
case S_FBWD: // from S_FBWD -----------------------------------
{
switch(toState)
}
}
}
+ FALLTHROUGH // keep compiler happy (all posibilities return)
case S_STOP: // from S_STOP -----------------------------------
{
switch(toState)
else
{
logger->log("Player", Log::DEBUG, "Demuxer said video is something else... setting it anyway");
- video->setAspectRatio(dxCurrentAspect,parx,pary);
+ video->setAspectRatio(static_cast<UCHAR>(dxCurrentAspect), parx, pary);
}
}
if (startup)
{
if (startupBlockSize > lengthBytes)
- askFor = lengthBytes; // is a very small recording!
+ askFor = static_cast<UINT>(lengthBytes); // is a very small recording!
else
askFor = startupBlockSize; // normal, but a startup sized block to detect all the audio streams
}
else
{
if ((feedPosition + blockSize) > lengthBytes) // last block of recording
- askFor = lengthBytes - feedPosition;
+ askFor = static_cast<UINT>(lengthBytes - feedPosition);
else // normal
askFor = blockSize;
}
UINT startupBlockSize{250000};
UCHAR* threadBuffer{};
UCHAR state{S_STOP};
- UCHAR ifactor{4};
+ UCHAR ifactor{4}; // 4, 8, 16, 32
};
#endif
case WM_DESTROY: {
//TODO: call command
logger->log("Core", Log::NOTICE, "Window closed, shutting down...");
-
- //inputWin->SendPower(); // FIXME this could be the only call
command->stop();
-
PostQuitMessage(0);
}break;
case WM_SIZING: {