vdr_remoteFrame Class Reference

Main Window frame, has one child main_panel. More...

#include <vdr_remote.h>

Collaboration diagram for vdr_remoteFrame:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vdr_remoteFrame (const wxString &title, const wxPoint &pos, const wxSize &pos, const long &style)
 Constructor, initializes the application's frame.
 ~vdr_remoteFrame ()
 Destructor.
void OnQuit (wxCommandEvent &event)
 Quit Event handler.
void OnAbout (wxCommandEvent &event)
 Displays the about box.
void OnBtnPrefs (wxCommandEvent &event)
 Displays the preferences dialog and handles configuration writing.
void OnSocketEvent (wxSocketEvent &event)
 Handles all Socket Events.
void OnSpinEvent (wxSpinEvent &event)
 Handles all Socket Events.
void OnAccelerator (wxCommandEvent &event)
 handles keyboard input and button clicks
void ToggleStayOnTop (wxCommandEvent &event)
 Toggles the Stay on top feature on or off.
void OnIconize (wxIconizeEvent &event)
 Handles Minimize/Maximize Events.
void LoadPreferences ()
 Load platform-specific user preferences.
void GetDiskStat (wxCommandEvent &event)
 Get vdr's Disk Status.
void ShowHelpDlg (wxCommandEvent &event)
 Display online Help.

Protected Member Functions

void SendMessage (const char *the_msg)
 Send a message to vdr.
void Connect ()
 Connect the socket to vdr.
void Disconnect ()
 Disconnect the socket to vdr.
void AddNumberButtons (wxFlexGridSizer *numeric_box)
 Adds the buttons 0-9 and Ch+,Ch- to the given sizer.
void AddUserButtons (wxFlexGridSizer *userbuttons_box)
 Adds the buttons User1-User9 to the given sizer.
void AddExtendedButtons (wxFlexGridSizer *extended_keys_box)
 Adds the buttons Channels, Commands, ... to the given sizer.
void AddPlayerButtons (wxFlexGridSizer *player_box)
 Adds the player buttons (Play,Record,...) to the given sizer.
void AddColourButtons (wxFlexGridSizer *col_box)
 Adds the the four colour buttons to the given sizer.
void AddMenuButtons (wxFlexGridSizer *menu_box)
 Adds the Menu,Back,Ok and arrow buttons to the given sizer.

Protected Attributes

wxSocketClient * vdr_client
 the pointer to the socket instance
wxIPV4address vdr_adress
 vdr adress, IP and port
bool connection_is_alive
 flag, tells if the socket connection is valid and alive
bool show_socket_viewer
 flag, tells if socket_viewer should be shown
bool show_player_buttons
 flag, tells if player buttons should be shown
bool show_user_buttons
 flag, tells if user buttons should be shown
bool socket_data_needed
 flag, tells OnSocketEvent if it should copy incoming data to my_socket_buffer
bool socket_data_available
 flag, signals if data is available in my_socket_buffer
long vdr_port
 port to use for svdrp
long disk_status_timeout
 host adress of the vdr
wxString vdr_host
 timeout in ms for GetDiskStat()
wxArrayString my_user_button_titles
 an array holding all custom user button tooltips
wxConfig * my_prefs
 for platform-independent preferences handling
wxTextCtrl * socket_viewer
 the pointer to the socket_viewer instance
wxBitmapButton * key_ok
 we need a pointer to the ok key so focus handling / enter key works correctly on windows
MyTaskbarIconmy_tb_icon
 the icon used when minimized to the system tray
wxPanel * main_panel
 Main Window panel , parent of all controls.
int num_connection_failures
 total number of failed connections
char * my_socket_buffer
 temporary storage buffer for returned socket data

Detailed Description

Main Window frame, has one child main_panel.

Definition at line 64 of file vdr_remote.h.


Constructor & Destructor Documentation

vdr_remoteFrame::vdr_remoteFrame const wxString &  title,
const wxPoint &  pos,
const wxSize &  pos,
const long &  style
 

Constructor, initializes the application's frame.

Definition at line 75 of file vdr_remote.cpp.

References AddColourButtons(), AddExtendedButtons(), AddMenuButtons(), AddNumberButtons(), AddPlayerButtons(), AddUserButtons(), connection_is_alive, key_ok, LoadPreferences(), main_panel, my_prefs, my_tb_icon, num_connection_failures, show_player_buttons, show_socket_viewer, show_user_buttons, socket_data_available, socket_data_needed, socket_viewer, and vdr_client.

Here is the call graph for this function:

vdr_remoteFrame::~vdr_remoteFrame  ) 
 

Destructor.

Deletes dynamically allocated systray icon and preferences

Definition at line 69 of file vdr_remote.cpp.

References my_prefs, and my_tb_icon.


Member Function Documentation

void vdr_remoteFrame::AddColourButtons wxFlexGridSizer *  col_box  )  [protected]
 

Adds the the four colour buttons to the given sizer.

Called from vdr_remoteFrame constructor.

Parameters:
col_box The Sizer to which the buttons should be added

Definition at line 171 of file gui_setup.cpp.

References main_panel.

Referenced by vdr_remoteFrame().

void vdr_remoteFrame::AddExtendedButtons wxFlexGridSizer *  extended_keys_box  )  [protected]
 

Adds the buttons Channels, Commands, ... to the given sizer.

Called from vdr_remoteFrame constructor.

Parameters:
extended_keys_box The Sizer to which the buttons should be added

Definition at line 109 of file gui_setup.cpp.

References main_panel.

Referenced by vdr_remoteFrame().

void vdr_remoteFrame::AddMenuButtons wxFlexGridSizer *  menu_box  )  [protected]
 

Adds the Menu,Back,Ok and arrow buttons to the given sizer.

Called from vdr_remoteFrame constructor.

Parameters:
menu_box The Sizer to which the buttons should be added

Definition at line 187 of file gui_setup.cpp.

References key_ok, and main_panel.

Referenced by vdr_remoteFrame().

void vdr_remoteFrame::AddNumberButtons wxFlexGridSizer *  numeric_box  )  [protected]
 

Adds the buttons 0-9 and Ch+,Ch- to the given sizer.

Called from vdr_remoteFrame constructor.

Parameters:
numeric_box The Sizer to which the buttons should be added

Definition at line 25 of file gui_setup.cpp.

References main_panel.

Referenced by vdr_remoteFrame().

void vdr_remoteFrame::AddPlayerButtons wxFlexGridSizer *  player_box  )  [protected]
 

Adds the player buttons (Play,Record,...) to the given sizer.

Called from vdr_remoteFrame constructor.

Parameters:
player_box The Sizer to which the buttons should be added

Definition at line 140 of file gui_setup.cpp.

References main_panel.

Referenced by vdr_remoteFrame().

void vdr_remoteFrame::AddUserButtons wxFlexGridSizer *  userbuttons_box  )  [protected]
 

Adds the buttons User1-User9 to the given sizer.

Called from vdr_remoteFrame constructor.

Parameters:
userbuttons_box The Sizer to which the buttons should be added

Definition at line 77 of file gui_setup.cpp.

References main_panel, and my_user_button_titles.

Referenced by vdr_remoteFrame().

void vdr_remoteFrame::Connect  )  [protected]
 

Connect the socket to vdr.

Definition at line 91 of file socket.cpp.

References connection_is_alive, num_connection_failures, vdr_adress, vdr_client, vdr_host, and vdr_port.

Referenced by GetDiskStat(), and SendMessage().

void vdr_remoteFrame::Disconnect  )  [protected]
 

Disconnect the socket to vdr.

Definition at line 123 of file socket.cpp.

References SendMessage(), and vdr_client.

Referenced by SendMessage().

Here is the call graph for this function:

void vdr_remoteFrame::GetDiskStat wxCommandEvent &  event  ) 
 

Get vdr's Disk Status.

Definition at line 138 of file socket.cpp.

References Connect(), disk_status_timeout, my_socket_buffer, socket_data_available, socket_data_needed, and vdr_client.

Here is the call graph for this function:

void vdr_remoteFrame::LoadPreferences  ) 
 

Load platform-specific user preferences.

See also:
vdr_remoteFrame

Definition at line 38 of file preferences.cpp.

References my_prefs, and vdr_host.

Referenced by vdr_remoteFrame().

void vdr_remoteFrame::OnAbout wxCommandEvent &  event  ) 
 

Displays the about box.

Returns:
nothing

void vdr_remoteFrame::OnAccelerator wxCommandEvent &  event  ) 
 

handles keyboard input and button clicks

Parameters:
event The current event, eventGetId() determines which action is triggered

Definition at line 245 of file vdr_remote.cpp.

References SendMessage(), and socket_data_needed.

Here is the call graph for this function:

void vdr_remoteFrame::OnBtnPrefs wxCommandEvent &  event  ) 
 

Displays the preferences dialog and handles configuration writing.

Definition at line 91 of file preferences.cpp.

References disk_status_timeout, my_prefs, my_user_button_titles, OnSpinEvent(), show_player_buttons, show_socket_viewer, show_user_buttons, vdr_host, and vdr_port.

Here is the call graph for this function:

void vdr_remoteFrame::OnIconize wxIconizeEvent &  event  ) 
 

Handles Minimize/Maximize Events.

Definition at line 45 of file gui_events.cpp.

void vdr_remoteFrame::OnQuit wxCommandEvent &  event  ) 
 

Quit Event handler.

Deletes dynamically allocated objects

void vdr_remoteFrame::OnSocketEvent wxSocketEvent &  event  ) 
 

Handles all Socket Events.

Parameters:
event The Socket event to process

Definition at line 29 of file socket.cpp.

References connection_is_alive, my_socket_buffer, show_socket_viewer, socket_data_available, socket_data_needed, socket_viewer, and vdr_client.

void vdr_remoteFrame::OnSpinEvent wxSpinEvent &  event  ) 
 

Handles all Socket Events.

Parameters:
event The Socket event to process

Definition at line 77 of file gui_events.cpp.

References disk_status_timeout.

Referenced by OnBtnPrefs().

void vdr_remoteFrame::SendMessage const char *  the_msg  )  [protected]
 

Send a message to vdr.

Parameters:
the_msg The Message to send
Note:
SendMessage() discards the repsonse

Definition at line 204 of file socket.cpp.

References Connect(), Disconnect(), socket_data_needed, and vdr_client.

Referenced by Disconnect(), and OnAccelerator().

Here is the call graph for this function:

void vdr_remoteFrame::ShowHelpDlg wxCommandEvent &  event  ) 
 

Display online Help.

Definition at line 64 of file gui_events.cpp.

void vdr_remoteFrame::ToggleStayOnTop wxCommandEvent &  event  ) 
 

Toggles the Stay on top feature on or off.

Bug:
Stay on top doesn't work on OSX 10.4. This is due to the stock wx Library 2.5.3, it is fixed in wx 2.7.1 and will hopefully make it as wx 2.8.0 into OSX 10.5.

Definition at line 30 of file gui_events.cpp.


Member Data Documentation

bool vdr_remoteFrame::connection_is_alive [protected]
 

flag, tells if the socket connection is valid and alive

Definition at line 161 of file vdr_remote.h.

Referenced by Connect(), OnSocketEvent(), and vdr_remoteFrame().

long vdr_remoteFrame::disk_status_timeout [protected]
 

host adress of the vdr

Definition at line 193 of file vdr_remote.h.

Referenced by GetDiskStat(), OnBtnPrefs(), and OnSpinEvent().

wxBitmapButton* vdr_remoteFrame::key_ok [protected]
 

we need a pointer to the ok key so focus handling / enter key works correctly on windows

On windows vdr_remote insists on setting the focus on the last button clicked, so Enter doesn´t work as a hotkey. By setting focus to this key after every focus-changing action we make sure Enter always triggers the Ok key.

Definition at line 229 of file vdr_remote.h.

Referenced by AddMenuButtons(), and vdr_remoteFrame().

wxPanel* vdr_remoteFrame::main_panel [protected]
 

Main Window panel , parent of all controls.

Definition at line 239 of file vdr_remote.h.

Referenced by AddColourButtons(), AddExtendedButtons(), AddMenuButtons(), AddNumberButtons(), AddPlayerButtons(), AddUserButtons(), and vdr_remoteFrame().

wxConfig* vdr_remoteFrame::my_prefs [protected]
 

for platform-independent preferences handling

Definition at line 216 of file vdr_remote.h.

Referenced by LoadPreferences(), OnBtnPrefs(), vdr_remoteFrame(), and ~vdr_remoteFrame().

char* vdr_remoteFrame::my_socket_buffer [protected]
 

temporary storage buffer for returned socket data

Contains the data vdr returned when socket_data_available is true.

See also:
socket_data_available

Definition at line 254 of file vdr_remote.h.

Referenced by GetDiskStat(), and OnSocketEvent().

MyTaskbarIcon* vdr_remoteFrame::my_tb_icon [protected]
 

the icon used when minimized to the system tray

Definition at line 234 of file vdr_remote.h.

Referenced by vdr_remoteFrame(), and ~vdr_remoteFrame().

wxArrayString vdr_remoteFrame::my_user_button_titles [protected]
 

an array holding all custom user button tooltips

Definition at line 211 of file vdr_remote.h.

Referenced by AddUserButtons(), and OnBtnPrefs().

int vdr_remoteFrame::num_connection_failures [protected]
 

total number of failed connections

Used to count the failed connection. Is reset to zero when

  • the connection is established
  • when the user dismisses the "Too many connection failures" error message

Definition at line 247 of file vdr_remote.h.

Referenced by Connect(), and vdr_remoteFrame().

bool vdr_remoteFrame::show_player_buttons [protected]
 

flag, tells if player buttons should be shown

Definition at line 161 of file vdr_remote.h.

Referenced by OnBtnPrefs(), and vdr_remoteFrame().

bool vdr_remoteFrame::show_socket_viewer [protected]
 

flag, tells if socket_viewer should be shown

Definition at line 161 of file vdr_remote.h.

Referenced by OnBtnPrefs(), OnSocketEvent(), and vdr_remoteFrame().

bool vdr_remoteFrame::show_user_buttons [protected]
 

flag, tells if user buttons should be shown

Definition at line 161 of file vdr_remote.h.

Referenced by OnBtnPrefs(), and vdr_remoteFrame().

bool vdr_remoteFrame::socket_data_available [protected]
 

flag, signals if data is available in my_socket_buffer

See also:
my_socket_buffer

Definition at line 161 of file vdr_remote.h.

Referenced by GetDiskStat(), OnSocketEvent(), and vdr_remoteFrame().

bool vdr_remoteFrame::socket_data_needed [protected]
 

flag, tells OnSocketEvent if it should copy incoming data to my_socket_buffer

See also:
my_socket_buffer

Definition at line 161 of file vdr_remote.h.

Referenced by GetDiskStat(), OnAccelerator(), OnSocketEvent(), SendMessage(), and vdr_remoteFrame().

wxTextCtrl* vdr_remoteFrame::socket_viewer [protected]
 

the pointer to the socket_viewer instance

Note:
if show_socket_viewer is false socket_viewer will be invalid
See also:
show_socket_viewer

Definition at line 223 of file vdr_remote.h.

Referenced by OnSocketEvent(), and vdr_remoteFrame().

wxIPV4address vdr_remoteFrame::vdr_adress [protected]
 

vdr adress, IP and port

vdr_adress is used internally only

Definition at line 156 of file vdr_remote.h.

Referenced by Connect().

wxSocketClient* vdr_remoteFrame::vdr_client [protected]
 

the pointer to the socket instance

Definition at line 150 of file vdr_remote.h.

Referenced by Connect(), Disconnect(), GetDiskStat(), OnSocketEvent(), SendMessage(), and vdr_remoteFrame().

wxString vdr_remoteFrame::vdr_host [protected]
 

timeout in ms for GetDiskStat()

See also:
GetDiskStat()

Definition at line 206 of file vdr_remote.h.

Referenced by Connect(), LoadPreferences(), and OnBtnPrefs().

long vdr_remoteFrame::vdr_port [protected]
 

port to use for svdrp

Definition at line 193 of file vdr_remote.h.

Referenced by Connect(), and OnBtnPrefs().


The documentation for this class was generated from the following files:
Generated on Sun Nov 5 22:39:03 2006 for vdr_remote by  doxygen 1.4.6