void UpdateImageOfCamera()
{
  if (VideoInput_NewFrameAvailiable(0))
   {
     if ( camera_feed != 0 ) { delete camera_feed; camera_feed=0; }

     void *frame=VideoInput_GetFrame(0);
       if ( frame != 0)
        {
            img.SetData((unsigned char *)frame,320,240,true);
            camera_feed = new wxBitmap(img);
        }
   }
  }
FlashySlideShowStarterFrame::FlashySlideShowStarterFrame(wxWindow* parent,wxWindowID id)
{
    //(*Initialize(FlashySlideShowStarterFrame)
    wxMenuItem* MenuItem2;
    wxMenuItem* MenuItem1;
    wxMenu* Menu1;
    wxMenuItem* MenuItem3;
    wxMenuBar* MenuBar1;
    wxMenuItem* MenuItem10;
    wxMenuItem* MenuItem4;
    wxMenu* Menu2;
    wxMenuItem* MenuItem8;

    Create(parent, wxID_ANY, _("Flashy SlideShow Starter "), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY"));
    SetClientSize(wxSize(685,551));
    StaticBox2 = new wxStaticBox(this, ID_STATICBOX2, _("Slideshow Options"), wxPoint(448,16), wxSize(224,384), 0, _T("ID_STATICBOX2"));
    StaticBox1 = new wxStaticBox(this, ID_STATICBOX1, _("Folder Preview"), wxPoint(32,16), wxSize(408,360), 0, _T("ID_STATICBOX1"));
    ButtonStart = new wxButton(this, ID_BUTTON1, _("Start!"), wxPoint(448,408), wxSize(216,48), 0, wxDefaultValidator, _T("ID_BUTTON1"));
    wxFont ButtonStartFont(32,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Sans"),wxFONTENCODING_DEFAULT);
    ButtonStart->SetFont(ButtonStartFont);
    ButtonQuit = new wxButton(this, ID_BUTTON2, _("Quit"), wxPoint(600,464), wxSize(61,29), 0, wxDefaultValidator, _T("ID_BUTTON2"));
    StaticText2 = new wxStaticText(this, ID_STATICTEXT2, _("Directory :"), wxPoint(32,388), wxDefaultSize, 0, _T("ID_STATICTEXT2"));
    PathTextCtrl = new wxTextCtrl(this, ID_TEXTCTRL1, _("~/Pictures"), wxPoint(104,384), wxSize(336,27), wxTE_PROCESS_ENTER, wxDefaultValidator, _T("ID_TEXTCTRL1"));
    CheckBoxSound = new wxCheckBox(this, ID_CHECKBOX1, _("Sound Effects"), wxPoint(456,280), wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
    CheckBoxSound->SetValue(true);
    CheckBoxFaceDetection = new wxCheckBox(this, ID_CHECKBOX2, _("Face Detection"), wxPoint(456,248), wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX2"));
    CheckBoxFaceDetection->SetValue(true);
    ComboBoxTransitions = new wxComboBox(this, ID_COMBOBOX1, wxEmptyString, wxPoint(456,102), wxSize(128,29), 0, 0, 0, wxDefaultValidator, _T("ID_COMBOBOX1"));
    ComboBoxTransitions->SetSelection( ComboBoxTransitions->Append(_("3D Seek")) );
    ComboBoxTransitions->Append(_("Immediate"));
    ComboBoxTransitions->Append(_("Transparency"));
    StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Transitions"), wxPoint(456,86), wxDefaultSize, 0, _T("ID_STATICTEXT1"));
    PictureFolder = new wxGenericDirCtrl(this, ID_GENERICDIRCTRL1, _T("~/Pictures"), wxPoint(40,48), wxSize(384,320), 0, wxEmptyString, 0, _T("ID_GENERICDIRCTRL1"));
    CheckBoxVisuals = new wxCheckBox(this, ID_CHECKBOX3, _("Visual Effects"), wxPoint(456,264), wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX3"));
    CheckBoxVisuals->SetValue(true);
    DelaySpinCtrl = new wxSpinCtrl(this, ID_SPINCTRL1, _T("5000"), wxPoint(496,138), wxSize(64,27), 0, 100, 10000, 5000, _T("ID_SPINCTRL1"));
    DelaySpinCtrl->SetValue(_T("5000"));
    StaticText3 = new wxStaticText(this, ID_STATICTEXT3, _("Delay"), wxPoint(456,142), wxDefaultSize, 0, _T("ID_STATICTEXT3"));
    StaticText4 = new wxStaticText(this, ID_STATICTEXT4, _("ms"), wxPoint(560,144), wxDefaultSize, 0, _T("ID_STATICTEXT4"));
    CheckBoxIncludeSubfolders = new wxCheckBox(this, ID_CHECKBOX4, _("Include Subfolders"), wxPoint(456,216), wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX4"));
    CheckBoxIncludeSubfolders->SetValue(false);
    StaticText5 = new wxStaticText(this, ID_STATICTEXT5, _("Picture Quality"), wxPoint(456,40), wxDefaultSize, 0, _T("ID_STATICTEXT5"));
    ComboBoxQuality = new wxComboBox(this, ID_COMBOBOX2, wxEmptyString, wxPoint(456,56), wxSize(128,29), 0, 0, 0, wxDefaultValidator, _T("ID_COMBOBOX2"));
    ComboBoxQuality->Append(_("Very Low"));
    ComboBoxQuality->Append(_("Low"));
    ComboBoxQuality->Append(_("Medium"));
    ComboBoxQuality->SetSelection( ComboBoxQuality->Append(_("Good")) );
    ComboBoxQuality->Append(_("High"));
    ComboBoxQuality->Append(_("Very High"));
    ComboBoxQuality->Append(_("Ultra"));
    CheckBoxMipmap = new wxCheckBox(this, ID_CHECKBOX5, _("Use Mipmaping"), wxPoint(456,232), wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX5"));
    CheckBoxMipmap->SetValue(false);
    DateText = new wxStaticText(this, ID_STATICTEXT6, _("Select a directory and then click Start to begin Slideshow"), wxPoint(32,416), wxDefaultSize, 0, _T("ID_STATICTEXT6"));
    ButtonControls = new wxButton(this, ID_BUTTON3, _("Controls"), wxPoint(448,464), wxSize(144,29), 0, wxDefaultValidator, _T("ID_BUTTON3"));
    StaticText7 = new wxStaticText(this, ID_STATICTEXT7, _("Sort Pictures By"), wxPoint(456,168), wxDefaultSize, 0, _T("ID_STATICTEXT7"));
    ComboBoxSort = new wxComboBox(this, ID_COMBOBOX3, wxEmptyString, wxPoint(456,186), wxSize(200,29), 0, 0, 0, wxDefaultValidator, _T("ID_COMBOBOX3"));
    ComboBoxSort->SetSelection( ComboBoxSort->Append(_("Names Ascending")) );
    ComboBoxSort->Append(_("Dates Ascending"));
    ComboBoxSort->Append(_("Sizes Ascending"));
    ComboBoxSort->Append(_("Names Descending"));
    ComboBoxSort->Append(_("Dates Descending"));
    ComboBoxSort->Append(_("Sizes Descending"));
    ComboBoxSort->Append(_("Random"));
    CheckBoxFileMove = new wxCheckBox(this, ID_CHECKBOX6, _("File Move"), wxPoint(456,296), wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX6"));
    CheckBoxFileMove->SetValue(false);
    CheckBoxFileMove->SetToolTip(_("Selecting this option will make the buttons 1,2,3,4,5,6,7,8,9,0 move thecurrently viewed picture inside the Moved/CategoryX/ folder where X is the number pressed"));
    CheckBoxFileMove->SetHelpText(_("Selecting this option will make the buttons 1,2,3,4,5,6,7,8,9,0 move thecurrently viewed picture inside the Moved/CategoryX/ folder where X is the number pressed"));
    CheckBoxFileResize = new wxCheckBox(this, ID_CHECKBOX7, _("File Resize"), wxPoint(456,312), wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX7"));
    CheckBoxFileResize->SetValue(false);
    CheckBoxFileResize->SetToolTip(_("Selecting this option will make the buttons 1,2,3,4,5,6,7,8,9,0 make a resized copy of the currently viewed picture inside the Resized/CategoryX/ folder where X is the number pressed"));
    CheckBoxFileResize->SetHelpText(_("Selecting this option will make the buttons 1,2,3,4,5,6,7,8,9,0 make a resized copy of the currently viewed picture inside the Resized/CategoryX/ folder where X is the number pressed"));
    ComboBoxResizeResolution = new wxComboBox(this, ID_COMBOBOX4, wxEmptyString, wxPoint(552,320), wxSize(104,29), 0, 0, 0, wxDefaultValidator, _T("ID_COMBOBOX4"));
    ComboBoxResizeResolution->Append(_("320x240"));
    ComboBoxResizeResolution->Append(_("640x480"));
    ComboBoxResizeResolution->Append(_("1024x768"));
    ComboBoxResizeResolution->Append(_("1280x720"));
    ComboBoxResizeResolution->SetSelection( ComboBoxResizeResolution->Append(_("1920x1080")) );
    ComboBoxResizeResolution->Append(_("30%"));
    ComboBoxResizeResolution->Append(_("50%"));
    ComboBoxResizeResolution->Disable();
    wxFont ComboBoxResizeResolutionFont(8,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Sans"),wxFONTENCODING_DEFAULT);
    ComboBoxResizeResolution->SetFont(ComboBoxResizeResolutionFont);
    CheckBoxFileCopy = new wxCheckBox(this, ID_CHECKBOX8, _("File Copy"), wxPoint(456,328), wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX8"));
    CheckBoxFileCopy->SetValue(false);
    ImagesPerLine = new wxSpinCtrl(this, ID_SPINCTRL2, _T("3"), wxPoint(600,102), wxSize(56,27), 0, 1, 10, 3, _T("ID_SPINCTRL2"));
    ImagesPerLine->SetValue(_T("3"));
    StaticText6 = new wxStaticText(this, ID_STATICTEXT8, _("Images"), wxPoint(600,56), wxDefaultSize, 0, _T("ID_STATICTEXT8"));
    StaticText8 = new wxStaticText(this, ID_STATICTEXT9, _("per line :"), wxPoint(600,72), wxDefaultSize, 0, _T("ID_STATICTEXT9"));
    StaticText9 = new wxStaticText(this, ID_STATICTEXT10, _("Custom Args :"), wxPoint(456,368), wxDefaultSize, 0, _T("ID_STATICTEXT10"));
    Arguments = new wxTextCtrl(this, ID_TEXTCTRL2, wxEmptyString, wxPoint(552,368), wxSize(104,23), 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));
    CheckBoxFileLink = new wxCheckBox(this, ID_CHECKBOX9, _("File Link"), wxPoint(456,344), wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX9"));
    CheckBoxFileLink->SetValue(false);
    MenuBar1 = new wxMenuBar();
    Menu1 = new wxMenu();
    MenuItem1 = new wxMenuItem(Menu1, idMenuQuit, _("Quit\tAlt-F4"), _("Quit the application"), wxITEM_NORMAL);
    Menu1->Append(MenuItem1);
    MenuBar1->Append(Menu1, _("&File"));
    Menu3 = new wxMenu();
    MenuItem8 = new wxMenuItem(Menu3, idMenuPlay, _("Immediate Playback"), wxEmptyString, wxITEM_CHECK);
    Menu3->Append(MenuItem8);
    MenuItem12 = new wxMenuItem(Menu3, idMenuEconomy, _("Economy"), wxEmptyString, wxITEM_CHECK);
    Menu3->Append(MenuItem12);
    MenuItem11 = new wxMenuItem(Menu3, idMenuFullscreenCommand, _("Fullscreen"), wxEmptyString, wxITEM_CHECK);
    Menu3->Append(MenuItem11);
    MenuItem11->Check(true);
    MenuItem5 = new wxMenuItem(Menu3, idMenuWebInterface, _("Web Interface"), wxEmptyString, wxITEM_CHECK);
    Menu3->Append(MenuItem5);
    MenuItem7 = new wxMenuItem(Menu3, idMenuHUD, _("Heads Up Display"), wxEmptyString, wxITEM_CHECK);
    Menu3->Append(MenuItem7);
    MenuItem6 = new wxMenuItem(Menu3, idMenuSimpleBackground, _("Simple Background"), wxEmptyString, wxITEM_CHECK);
    Menu3->Append(MenuItem6);
    MenuItem9 = new wxMenuItem(Menu3, idMenuViewCommand, _("View Command before startup"), wxEmptyString, wxITEM_CHECK);
    Menu3->Append(MenuItem9);
    MenuBar1->Append(Menu3, _("More Options"));
    Menu2 = new wxMenu();
    MenuItem3 = new wxMenuItem(Menu2, idMenuGithub, _("Visit Github Repository"), _("Click to open the github repository of FlashySlideshows on your browser"), wxITEM_NORMAL);
    Menu2->Append(MenuItem3);
    MenuItem4 = new wxMenuItem(Menu2, idMenuAmmarkoVWebsite, _("Visit Author\'s Website"), _("Click to open the website of the author of the program"), wxITEM_NORMAL);
    Menu2->Append(MenuItem4);
    MenuItem10 = new wxMenuItem(Menu2, idMenuCheckNewVersion, _("Check for a new version"), wxEmptyString, wxITEM_NORMAL);
    Menu2->Append(MenuItem10);
    MenuItem2 = new wxMenuItem(Menu2, idMenuAbout, _("About\tF1"), _("Show info about this application"), wxITEM_NORMAL);
    Menu2->Append(MenuItem2);
    MenuBar1->Append(Menu2, _("Help"));
    SetMenuBar(MenuBar1);
    StatusBar1 = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1"));
    int __wxStatusBarWidths_1[1] = { -1 };
    int __wxStatusBarStyles_1[1] = { wxSB_NORMAL };
    StatusBar1->SetFieldsCount(1,__wxStatusBarWidths_1);
    StatusBar1->SetStatusStyles(1,__wxStatusBarStyles_1);
    SetStatusBar(StatusBar1);

    Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnButtonStartClick);
    Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnButtonQuitClick);
    Connect(ID_TEXTCTRL1,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnPathTextCtrlText);
    Connect(ID_CHECKBOX1,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnCheckBoxSoundClick);
    Connect(ID_CHECKBOX2,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnCheckBoxFaceDetectionClick);
    Connect(ID_CHECKBOX3,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnCheckBoxVisualsClick);
    Connect(ID_CHECKBOX4,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnCheckBoxIncludeSubfoldersClick);
    Connect(ID_CHECKBOX5,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnCheckBoxMipmapClick);
    Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnButtonControlsClick);
    Connect(ID_CHECKBOX6,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnCheckBoxFileMoveClick);
    Connect(ID_CHECKBOX7,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnCheckBoxFileResizeClick);
    Connect(ID_CHECKBOX8,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnCheckBoxFileCopyClick);
    Connect(ID_CHECKBOX9,wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnCheckBoxFileLinkClick);
    Connect(idMenuQuit,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnQuit);
    Connect(idMenuAbout,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnAbout);
    //*)

    //TA KOUMPIA TOU MENU
    Connect(idMenuGithub,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OpenGithubSite);
    Connect(idMenuAmmarkoVWebsite,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OpenAmmarkoVSite);
    Connect(idMenuCheckNewVersion,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::CheckNewVersion);

    default_img_thumb.SetData((unsigned char *)EmptyThumbnail.pixel_data,EmptyThumbnail.width ,EmptyThumbnail.height,true);
    default_bmp_thumb = new wxBitmap(default_img_thumb);

    flashy_img.SetData((unsigned char *)FlashyLogo.pixel_data,FlashyLogo.width ,FlashyLogo.height,true);
    flashy_bmp = new wxBitmap(flashy_img);
   // free(pixel);


    StatusBar1->SetStatusText(wxT("Welcome to Flashy Slideshows!"));

    PathTreeCtrl=PictureFolder->GetTreeCtrl();

    Connect(PathTreeCtrl->GetId(),wxEVT_COMMAND_TREE_SEL_CHANGED,(wxObjectEventFunction)&FlashySlideShowStarterFrame::OnRefreshDir);

    ComboBoxResizeResolution->Disable();

    ButtonStart->SetLabel(wxT("Click"));
    ButtonStart->SetLabel(wxT("to"));
    ButtonStart->SetLabel(wxT("Start!"));

}