Wednesday, September 12, 2012

Here is some code I just wrote. I think it's brilliant. I need to think over it a bit more to make it easier but I'm pretty happy with it so I decided to post it here.

*Disclaimer* I am definitely not going to be the first person to think of this:

template <typename ctorType, typename dtorType>
class RiaaWrapper
RiaaWrapper(ctorType inCtor, dtorType inDtor)
: _inCtor(inCtor)
, _inDtor(inDtor)
ctorType _inCtor;
dtorType _inDtor;
You use it like this:

class AutoMutex2 : public RiaaWrapper<std::function<TTV_ErrorCode()>,  std::function<TTV_ErrorCode()> >
AutoMutex2(ttv::Mutex* m)
: RiaaWrapper<std::function<TTV_ErrorCode()>,  std::function<TTV_ErrorCode()> >
(std::bind(&ttv::Mutex::Lock, m, ttv::WAIT_INFINITE),
std::bind(&ttv::Mutex::Unlock, m))

And you can ofcourse use it for any class/pair of functions you want to call.

Wednesday, February 22, 2012

Keyboard shortcuts in the / video player.

In the future I hope will have a changes page and I can post this there, but until then I will post minor changes I make.

About a week ago I added keyboard shortcuts to the players, please note you have to have the player focused (click on it), and the shortcuts will not work in fullscreen mode (flash's fault).

  • Up/Down - Volume change
  • Page Down - Mute
  • Page Up - Un-Mute
  • Control- P - Popout
  • Control-F - Fullscreen

If anyone has ideas for keys, feel free to tell me.