Imported Upstream version 0.4.5+svn3462~dfsg0
authorAlessio Treglia <alessio@debian.org>
Fri, 10 Feb 2012 21:48:44 +0000 (22:48 +0100)
committerAlessio Treglia <alessio@debian.org>
Fri, 10 Feb 2012 21:48:44 +0000 (22:48 +0100)
157 files changed:
applications/mp4box/filedump.c
applications/mp4box/fileimport.c
applications/mp4box/main.c
applications/mp4client/main.c
applications/osmo4_android/.classpath [deleted file]
applications/osmo4_android/.project [deleted file]
applications/osmo4_android/.settings/de.loskutov.anyedit.AnyEditTools.prefs [deleted file]
applications/osmo4_android/AndroidManifest.xml [deleted file]
applications/osmo4_android/Osmo4_keystore [deleted file]
applications/osmo4_android/build.properties [deleted file]
applications/osmo4_android/build.xml [deleted file]
applications/osmo4_android/default.properties [deleted file]
applications/osmo4_android/jni/README.txt [deleted file]
applications/osmo4_android/jni/wrapper.cpp [deleted file]
applications/osmo4_android/jni/wrapper.h [deleted file]
applications/osmo4_android/jni/wrapper_jni.c [deleted file]
applications/osmo4_android/res/drawable-hdpi/icon.png [deleted file]
applications/osmo4_android/res/drawable-ldpi/icon.png [deleted file]
applications/osmo4_android/res/drawable-mdpi/icon.png [deleted file]
applications/osmo4_android/res/layout/about_dialog.xml [deleted file]
applications/osmo4_android/res/layout/auth_requested.xml [deleted file]
applications/osmo4_android/res/layout/file_view.xml [deleted file]
applications/osmo4_android/res/menu/main_menu.xml [deleted file]
applications/osmo4_android/res/values/strings.xml [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/BitmapView.java [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/GPACInstance.java [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/GPACInstanceInterface.java [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/GpacCallback.java [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/GpacConfig.java [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/Osmo4.java [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/Osmo4GLSurfaceView.java [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/Osmo4Renderer.java [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/extra/FileArrayAdapter.java [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/extra/FileChooserActivity.java [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/extra/FileEntry.java [deleted file]
applications/osmo4_android/src/com/gpac/Osmo4/logs/GpacLogger.java [deleted file]
applications/osmo4_ios/Resources/icon.png [deleted file]
applications/osmo4_ios/Resources/osmo.icns [deleted file]
applications/osmo4_ios/extract.c [deleted file]
applications/osmo4_ios/main.c [deleted file]
applications/osmo4_ios/osmo4ios-Info.plist [deleted file]
applications/osmo4_sym/aif/osmo4_icon.bmp [deleted file]
applications/osmo4_sym/aif/osmo4_icon_mask.bmp [deleted file]
applications/osmo4_sym/aif/osmo4_menu.bmp [deleted file]
applications/osmo4_sym/aif/osmo4_menu_mask.bmp [deleted file]
applications/osmo4_sym/aif/osmo4aif.rss [deleted file]
applications/osmo4_sym/osmo4.cpp [deleted file]
applications/osmo4_sym/osmo4.h [deleted file]
applications/osmo4_sym/osmo4_ui.cpp [deleted file]
applications/osmo4_sym/osmo4_ui.h [deleted file]
applications/osmo4_sym/osmo4_view.cpp [deleted file]
applications/osmo4_sym/osmo4_view.h [deleted file]
applications/osmo4_sym/playlist.cpp [deleted file]
applications/osmo4_sym/playlist.h [deleted file]
applications/osmo4_sym/res/osmo4.rss [deleted file]
applications/osmo4_sym/res/osmo4.svg [deleted file]
applications/osmo4_sym/res/osmo4_caption.rss [deleted file]
applications/osmo4_sym/res/osmo4_gen.rss [deleted file]
applications/osmo4_sym/res/osmo4_reg.rss [deleted file]
applications/osmo4_w32/AddressBar.cpp [deleted file]
applications/osmo4_w32/AddressBar.h [deleted file]
applications/osmo4_w32/FileProps.cpp [deleted file]
applications/osmo4_w32/FileProps.h [deleted file]
applications/osmo4_w32/MainFrm.cpp [deleted file]
applications/osmo4_w32/MainFrm.h [deleted file]
applications/osmo4_w32/OpenUrl.cpp [deleted file]
applications/osmo4_w32/OpenUrl.h [deleted file]
applications/osmo4_w32/Options.cpp [deleted file]
applications/osmo4_w32/Options.h [deleted file]
applications/osmo4_w32/Osmo4.cpp [deleted file]
applications/osmo4_w32/Osmo4.h [deleted file]
applications/osmo4_w32/Osmo4.rc [deleted file]
applications/osmo4_w32/Playlist.cpp [deleted file]
applications/osmo4_w32/Playlist.h [deleted file]
applications/osmo4_w32/Sliders.cpp [deleted file]
applications/osmo4_w32/Sliders.h [deleted file]
applications/osmo4_w32/StdAfx.cpp [deleted file]
applications/osmo4_w32/StdAfx.h [deleted file]
applications/osmo4_w32/res/Osmo4.rc2 [deleted file]
applications/osmo4_w32/res/error.ico [deleted file]
applications/osmo4_w32/res/maintool.bmp [deleted file]
applications/osmo4_w32/res/message.ico [deleted file]
applications/osmo4_w32/res/osmo4.ico [deleted file]
applications/osmo4_w32/res/pause.ico [deleted file]
applications/osmo4_w32/res/play.ico [deleted file]
applications/osmo4_w32/res/playlist.bmp [deleted file]
applications/osmo4_w32/res/stop.ico [deleted file]
applications/osmo4_w32/resource.h [deleted file]
applications/osmo4_wce/MainFrm.cpp [deleted file]
applications/osmo4_wce/MainFrm.h [deleted file]
applications/osmo4_wce/OpenDlg.cpp [deleted file]
applications/osmo4_wce/OpenDlg.h [deleted file]
applications/osmo4_wce/Options.cpp [deleted file]
applications/osmo4_wce/Options.h [deleted file]
applications/osmo4_wce/Osmo4.cpp [deleted file]
applications/osmo4_wce/Osmo4.h [deleted file]
applications/osmo4_wce/Osmo4.rc [deleted file]
applications/osmo4_wce/ProgressBar.cpp [deleted file]
applications/osmo4_wce/ProgressBar.h [deleted file]
applications/osmo4_wce/Resource.h [deleted file]
applications/osmo4_wce/StdAfx.cpp [deleted file]
applications/osmo4_wce/StdAfx.h [deleted file]
applications/osmo4_wce/newres.h [deleted file]
applications/osmo4_wce/res/Cmdbar.bmp [deleted file]
applications/osmo4_wce/res/Osmo4.ico [deleted file]
applications/osmo4_wce/res/Osmo4.rc2 [deleted file]
applications/osmo4_wx/Darwin.Info.plist [deleted file]
applications/osmo4_wx/Darwin.InfoPlist.strings [deleted file]
applications/osmo4_wx/Darwin.Osmo.icns [deleted file]
applications/osmo4_wx/Makefile [deleted file]
applications/osmo4_wx/Playlist.cpp [deleted file]
applications/osmo4_wx/Playlist.h [deleted file]
applications/osmo4_wx/fileprops.cpp [deleted file]
applications/osmo4_wx/fileprops.h [deleted file]
applications/osmo4_wx/menubtn.cpp [deleted file]
applications/osmo4_wx/menubtn.h [deleted file]
applications/osmo4_wx/osmo4.ico [deleted file]
applications/osmo4_wx/osmo4.xpm [deleted file]
applications/osmo4_wx/playlist.xpm [deleted file]
applications/osmo4_wx/resource.h [deleted file]
applications/osmo4_wx/toolbar.xpm [deleted file]
applications/osmo4_wx/wxGPACControl.cpp [deleted file]
applications/osmo4_wx/wxGPACControl.h [deleted file]
applications/osmo4_wx/wxOsmo4.cpp [deleted file]
applications/osmo4_wx/wxOsmo4.h [deleted file]
applications/osmo4_wx/wxOsmo4.rc [deleted file]
applications/osmophone/Osmo4.ico [deleted file]
applications/osmophone/main.cpp [deleted file]
applications/osmophone/newres.h [deleted file]
applications/osmophone/openfile.cpp [deleted file]
applications/osmophone/osmophone.rc [deleted file]
applications/osmophone/resource.h [deleted file]
doc/configuration.html
doc/man/mp4box.1
include/gpac/internal/terminal_dev.h
modules/Makefile
modules/aac_in/aac_in.c
modules/dx_hw/dx_2d.c
modules/osd/Makefile [new file with mode: 0644]
modules/osd/osd.c [new file with mode: 0644]
src/compositor/compositor.c
src/compositor/compositor_2d.c
src/compositor/mpeg4_grouping_2d.c
src/compositor/mpeg4_timesensor.c
src/export.cpp
src/media_tools/mpd.c
src/odf/descriptors.c
src/scene_manager/loader_bt.c
src/scenegraph/vrml_smjs.c
src/terminal/media_manager.c
src/terminal/network_service.c
src/terminal/object_manager.c
src/terminal/scene.c
src/terminal/terminal.c
src/utils/module.c
src/utils/module_wrap.h
src/utils/os_module.c

index 2d39a3d113225cadd10655bc65867ee02bac1c79..0a17d6a33b64e05d4708efd62f2bb8fd15aadc8e 100644 (file)
@@ -2139,7 +2139,8 @@ static void on_m2ts_dump_event(GF_M2TS_Demuxer *ts, u32 evt_type, void *par)
                break;
        case GF_M2TS_EVT_PMT_FOUND:
                prog = (GF_M2TS_Program*)par;
-               if (prog->number != dumper->prog_number) break;
+               if (gf_list_count(ts->programs)>1 && prog->number!=dumper->prog_number)
+                       break;
                if (index_info->start_indexing) {
                        if (!index_info->first_pmt_position_valid) {
                                index_info->first_pmt_position_valid = 1;
@@ -2172,7 +2173,8 @@ static void on_m2ts_dump_event(GF_M2TS_Demuxer *ts, u32 evt_type, void *par)
                break;
        case GF_M2TS_EVT_PMT_UPDATE:
                prog = (GF_M2TS_Program*)par;
-               if (prog->number != dumper->prog_number) break;
+               if (gf_list_count(ts->programs)>1 && prog->number!=dumper->prog_number)
+                       break;
                fprintf(stdout, "Program list updated - %d streams\n", gf_list_count( ((GF_M2TS_Program*)par)->streams) );
                if (index_info->start_indexing) {
                        if (!index_info->first_pmt_position_valid) {
@@ -2187,7 +2189,8 @@ static void on_m2ts_dump_event(GF_M2TS_Demuxer *ts, u32 evt_type, void *par)
                break;
        case GF_M2TS_EVT_PMT_REPEAT:
                prog = (GF_M2TS_Program*)par;
-               if (prog->number != dumper->prog_number) break;
+               if (gf_list_count(ts->programs)>1 && prog->number!=dumper->prog_number)
+                       break;
                if (index_info->start_indexing) {
                        if (!index_info->first_pmt_position_valid) {
                                index_info->first_pmt_position_valid = 1;
@@ -2221,12 +2224,14 @@ static void on_m2ts_dump_event(GF_M2TS_Demuxer *ts, u32 evt_type, void *par)
                break;
        case GF_M2TS_EVT_PES_TIMING:
                pck = par;
-               if (pck->stream->program->number != dumper->prog_number) break;
+               if (gf_list_count(ts->programs)>1 && pck->stream->program->number != dumper->prog_number)
+                       break;
 
                break;
        case GF_M2TS_EVT_PES_PCK:
                pck = par;
-               if (pck->stream->program->number != dumper->prog_number) break;
+               if (gf_list_count(ts->programs)>1 && pck->stream->program->number != dumper->prog_number)
+                       break;
                if (dumper->has_seen_pat) {
                        if (dumper->timestamps_info_file) {
                                GF_M2TS_PES *pes = pck->stream;
@@ -2286,7 +2291,8 @@ static void on_m2ts_dump_event(GF_M2TS_Demuxer *ts, u32 evt_type, void *par)
                break;
        case GF_M2TS_EVT_PES_PCR:
                pck = par;
-               if (pck->stream->program->number != dumper->prog_number) break;
+               if (gf_list_count(ts->programs)>1 && pck->stream->program->number != dumper->prog_number)
+                       break;
                if (dumper->timestamps_info_file) {
                        fprintf(dumper->timestamps_info_file, "%u\t%d\t%f\t\t\t\t%d\n", pck->stream->program->last_pcr_value_pck_number, pck->stream->pid, pck->PTS / (300*90000.0), (pck->flags & GF_M2TS_PES_PCK_DISCONTINUITY ? 1 : 0));
                }
index 4c8f45664e11710a291c620b9c1190a0cdee2f76..b45d9229c80103c1ff91665742aec0391a23d2c5 100644 (file)
@@ -1319,6 +1319,8 @@ GF_Err cat_isomedia_file(GF_ISOFile *dest, char *fileName, u32 import_flags, Dou
                        if (e) goto err_exit;
                        gf_isom_clone_pl_indications(orig, dest);
                        new_track = 1;
+                       /*remove cloned edit list, as it will be rewritten after import*/
+                       gf_isom_remove_edit_segments(dest, dst_tk);
                } else {
                        nb_edits = gf_isom_get_edit_segment_count(orig, i+1);
                }
index b096daf6eadf0f849ca27df04ecb9d90ca901fbf..a0b0cc38bc74773c5ad7a2320e7d9573110fa498 100644 (file)
@@ -252,6 +252,7 @@ void PrintGeneralUsage()
                        "                       Ignored if segments are stored in the output file.\n"
                        " -daisy-chain         Uses daisy-chain SIDX instead of hierarchical. Ignored if frags/sidx is 0.\n"
                        " -dash-ctx FILE       Stores/restore DASH timing from FILE.\n"
+                       " -dash-ts-prog N      program_number to be considered in case of an MPTS input file.\n"
                        "\n");
 }
 
index 58615088a2f92eb4ced2aa05b1aa5a2cc6a5065c..5de99c2f723c2f3b80e698a480305657968c2abf 100644 (file)
@@ -1135,7 +1135,7 @@ int main (int argc, char **argv)
                if (logfile) fclose(logfile);
                return 1;
        }
-       fprintf(stdout, "Modules Loaded (%d found in %s)\n", i, str);
+       fprintf(stdout, "Modules Found (%d in dir %s)\n", i, str);
 
        user.config = cfg_file;
        user.EventProc = GPAC_EventProc;
@@ -1148,6 +1148,7 @@ int main (int argc, char **argv)
        if (threading_flags & (GF_TERM_NO_DECODER_THREAD|GF_TERM_NO_COMPOSITOR_THREAD) ) term_step = 1;
 
        fprintf(stdout, "Loading GPAC Terminal\n");     
+       i = gf_sys_clock();
        term = gf_term_new(&user);
        if (!term) {
                fprintf(stdout, "\nInit error - check you have at least one video out and one rasterizer...\nFound modules:\n");
@@ -1158,7 +1159,7 @@ int main (int argc, char **argv)
                if (logfile) fclose(logfile);
                return 1;
        }
-       fprintf(stdout, "Terminal Loaded\n");
+       fprintf(stdout, "Terminal Loaded in %d ms\n", gf_sys_clock()-i);
 
        if (dump_mode) {
 //             gf_term_set_option(term, GF_OPT_VISIBLE, 0);
@@ -1697,13 +1698,14 @@ force_input:
                }
        }
 
+       i = gf_sys_clock();
        gf_term_disconnect(term);
        if (rti_file) UpdateRTInfo("Disconnected\n");
 
        fprintf(stdout, "Deleting terminal... ");
        if (playlist) fclose(playlist);
        gf_term_del(term);
-       fprintf(stdout, "OK\n");
+       fprintf(stdout, "done (in %d ms)\n", gf_sys_clock() - i);
 
        fprintf(stdout, "GPAC cleanup ...\n");
        gf_modules_del(user.modules);
@@ -1816,7 +1818,6 @@ void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number)
        GF_MediaInfo odi;
        u32 i, j, count, d_enum,id;
        GF_Err e;
-       char code[5];
        NetStatCommand com;
        GF_ObjectManager *odm, *root_odm = gf_term_get_root_object(term);
        if (!root_odm) return;
@@ -1925,64 +1926,42 @@ void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number)
                if (esd->dependsOnESID) fprintf(stdout, "\tDepends on Stream ID %d for decoding\n", esd->dependsOnESID);
 
                switch (esd->decoderConfig->streamType) {
-               case GF_STREAM_OD: fprintf(stdout, "\tOD Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_OCR: fprintf(stdout, "\tOCR Stream\n"); break;
-               case GF_STREAM_SCENE: fprintf(stdout, "\tScene Description Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
+               case GF_STREAM_OD:
+                       fprintf(stdout, "\tOD Stream - version %d\n", esd->decoderConfig->objectTypeIndication);
+                       break;
+               case GF_STREAM_OCR:
+                       fprintf(stdout, "\tOCR Stream\n");
+                       break;
+               case GF_STREAM_SCENE:
+                       fprintf(stdout, "\tScene Description Stream - version %d\n", esd->decoderConfig->objectTypeIndication);
+                       break;
                case GF_STREAM_VISUAL:
-                       fprintf(stdout, "\tVisual Stream - media type: ");
-                       switch (esd->decoderConfig->objectTypeIndication) {
-                       case GPAC_OTI_VIDEO_MPEG4_PART2: fprintf(stdout, "MPEG-4\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SIMPLE: fprintf(stdout, "MPEG-2 Simple Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_MAIN: fprintf(stdout, "MPEG-2 Main Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SNR: fprintf(stdout, "MPEG-2 SNR Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SPATIAL: fprintf(stdout, "MPEG-2 Spatial Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_HIGH: fprintf(stdout, "MPEG-2 High Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_422: fprintf(stdout, "MPEG-2 422 Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG1: fprintf(stdout, "MPEG-1\n"); break;
-                       case GPAC_OTI_IMAGE_JPEG: fprintf(stdout, "JPEG\n"); break;
-                       case GPAC_OTI_IMAGE_PNG: fprintf(stdout, "PNG\n"); break;
-                       case GPAC_OTI_IMAGE_JPEG_2000: fprintf(stdout, "JPEG2000\n"); break;
-                               
-                       case GPAC_OTI_MEDIA_GENERIC:
-                               memcpy(code, esd->decoderConfig->decoderSpecificInfo->data, 4);
-                               code[4] = 0;
-                               fprintf(stdout, "GPAC Intern (%s)\n", code);
-                               break;
-                       default:
-                               fprintf(stdout, "Private Type (0x%x)\n", esd->decoderConfig->objectTypeIndication);
-                               break;
-                       }
+                       fprintf(stdout, "\tVisual Stream - media type: %s", gf_esd_get_textual_description(esd));
                        break;
-
                case GF_STREAM_AUDIO:
-                       fprintf(stdout, "\tAudio Stream - media type: ");
-                       switch (esd->decoderConfig->objectTypeIndication) {
-                       case GPAC_OTI_AUDIO_AAC_MPEG4: fprintf(stdout, "MPEG-4\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_MP: fprintf(stdout, "MPEG-2 AAC Main Profile\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_LCP: fprintf(stdout, "MPEG-2 AAC LowComplexity Profile\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_SSRP: fprintf(stdout, "MPEG-2 AAC Scalable Sampling Rate Profile\n"); break;
-                       case GPAC_OTI_AUDIO_MPEG2_PART3: fprintf(stdout, "MPEG-2 Audio\n"); break;
-                       case GPAC_OTI_AUDIO_MPEG1: fprintf(stdout, "MPEG-1 Audio\n"); break;
-                       case GPAC_OTI_AUDIO_EVRC_VOICE: fprintf(stdout, "EVRC Audio\n"); break;
-                       case GPAC_OTI_AUDIO_SMV_VOICE: fprintf(stdout, "SMV Audio\n"); break;
-                       case GPAC_OTI_AUDIO_13K_VOICE: fprintf(stdout, "QCELP Audio\n"); break;
-                       case GPAC_OTI_MEDIA_GENERIC:
-                               memcpy(code, esd->decoderConfig->decoderSpecificInfo->data, 4);
-                               code[4] = 0;
-                               fprintf(stdout, "GPAC Intern (%s)\n", code);
-                               break;
-                       default:
-                               fprintf(stdout, "Private Type (0x%x)\n", esd->decoderConfig->objectTypeIndication);
-                               break;
-                       }
+                       fprintf(stdout, "\tAudio Stream - media type: %s", gf_esd_get_textual_description(esd));
+                       break;
+               case GF_STREAM_MPEG7:
+                       fprintf(stdout, "\tMPEG-7 Stream - version %d\n", esd->decoderConfig->objectTypeIndication);
+                       break;
+               case GF_STREAM_IPMP:
+                       fprintf(stdout, "\tIPMP Stream - version %d\n", esd->decoderConfig->objectTypeIndication);
+                       break;
+               case GF_STREAM_OCI:
+                       fprintf(stdout, "\tOCI Stream - version %d\n", esd->decoderConfig->objectTypeIndication);
+                       break;
+               case GF_STREAM_MPEGJ:
+                       fprintf(stdout, "\tMPEGJ Stream - version %d\n", esd->decoderConfig->objectTypeIndication);
+                       break;
+               case GF_STREAM_INTERACT:
+                       fprintf(stdout, "\tUser Interaction Stream - version %d\n", esd->decoderConfig->objectTypeIndication);
+                       break;
+               case GF_STREAM_TEXT:
+                       fprintf(stdout, "\tStreaming Text Stream - version %d\n", esd->decoderConfig->objectTypeIndication);
+                       break;
+               default:
+                       fprintf(stdout, "\tUnknown Stream\n");
                        break;
-               case GF_STREAM_MPEG7: fprintf(stdout, "\tMPEG-7 Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_IPMP: fprintf(stdout, "\tIPMP Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_OCI: fprintf(stdout, "\tOCI Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_MPEGJ: fprintf(stdout, "\tMPEGJ Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_INTERACT: fprintf(stdout, "\tUser Interaction Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_TEXT: fprintf(stdout, "\tStreaming Text Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               default: fprintf(stdout, "Unknown Stream\r\n"); break;
                }
 
                fprintf(stdout, "\tBuffer Size %d\n\tAverage Bitrate %d bps\n\tMaximum Bitrate %d bps\n", esd->decoderConfig->bufferSizeDB, esd->decoderConfig->avgBitrate, esd->decoderConfig->maxBitrate);
diff --git a/applications/osmo4_android/.classpath b/applications/osmo4_android/.classpath
deleted file mode 100644 (file)
index 2ae0f23..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="src" path="src"/>
-       <classpathentry kind="src" path="gen"/>
-       <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK">
-               <attributes>
-                       <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Osmo4/libs/armeabi"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/applications/osmo4_android/.project b/applications/osmo4_android/.project
deleted file mode 100644 (file)
index 2bb783b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>Osmo4</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>com.android.ide.eclipse.adt.ApkBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/applications/osmo4_android/.settings/de.loskutov.anyedit.AnyEditTools.prefs b/applications/osmo4_android/.settings/de.loskutov.anyedit.AnyEditTools.prefs
deleted file mode 100644 (file)
index c2330bf..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#Fri Oct 08 13:52:16 CEST 2010
-activeContentFilterList=*.makefile,makefile,*.Makefile,Makefile,Makefile.*,*.mk,MANIFEST.MF
-addNewLine=true
-convertActionOnSaave=AnyEdit.CnvrtTabToSpaces
-eclipse.preferences.version=1
-inActiveContentFilterList=
-javaTabWidthForJava=true
-org.eclipse.jdt.ui.editor.tab.width=2
-projectPropsEnabled=false
-removeTrailingSpaces=true
-replaceAllSpaces=false
-replaceAllTabs=false
-saveAndAddLine=false
-saveAndConvert=false
-saveAndTrim=true
-useModulo4Tabs=false
diff --git a/applications/osmo4_android/AndroidManifest.xml b/applications/osmo4_android/AndroidManifest.xml
deleted file mode 100644 (file)
index 44cb2a8..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.gpac.Osmo4"
-    android:versionCode="1" android:versionName="1.0">
-    <uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
-    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
-        <activity android:name=".Osmo4" android:label="@string/app_name" android:configChanges="orientation">
-            <!--             android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> -->
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.LAUNCHER"/>
-            </intent-filter>
-            <intent-filter android:label="View in Osmo">
-                <action android:name="android.intent.action.VIEW"/>
-                <category android:name="android.intent.category.DEFAULT"/>
-                <data android:mimeType="audio/*" android:scheme="http"/>
-                <data android:mimeType="audio/*"/>
-                <data android:mimeType="video/*" android:scheme="http"/>
-                <data android:mimeType="video/*"/>
-                <data android:mimeType="x-subtitle/*" android:scheme="http"/>
-                <data android:mimeType="x-subtitle/*"/>
-                <data android:mimeType="application/x-mpegurl" android:scheme="http"/>
-                <data android:mimeType="application/x-mpegurl"/>
-                <data android:scheme="udp"/>
-                <data android:scheme="rtsp"/>
-                <data android:mimeType="application/vnd.apple.mpegurl" android:scheme="http"/>
-                <data android:mimeType="application/vnd.apple.mpegurl"/>
-                <data android:mimeType="application/x-isomedia" android:scheme="http"/>
-                <data android:mimeType="application/x-isomedia"/>
-                <data android:mimeType="application/mp4" android:scheme="http"/>
-                <data android:mimeType="application/mp4"/>
-                <data android:mimeType="application/sdp" android:scheme="http"/>
-                <data android:mimeType="application/sdp"/>
-                <data android:mimeType="application/x-bt" android:scheme="http"/>
-                <data android:mimeType="application/x-bt"/>
-                <data android:mimeType="application/x-xmt" android:scheme="http"/>
-                <data android:mimeType="application/x-xmt"/>
-            </intent-filter>
-        </activity>
-        <activity android:label="@string/app_name" android:configChanges="orientation"
-            android:permission="android.permission.WRITE_EXTERNAL_STORAGE" android:name=".extra.FileChooserActivity">
-            <intent-filter android:priority="1">
-                <action android:name="org.openintents.action.PICK_FILE"/>
-                <category android:name="android.intent.category.DEFAULT"/>
-                <data android:scheme="file"/>
-            </intent-filter>
-        </activity>
-    </application>
-
-    <uses-sdk android:targetSdkVersion="4" android:minSdkVersion="4"/>
-    <uses-permission android:name="android.permission.INTERNET"/>
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
-</manifest>
diff --git a/applications/osmo4_android/Osmo4_keystore b/applications/osmo4_android/Osmo4_keystore
deleted file mode 100644 (file)
index d504ce3..0000000
Binary files a/applications/osmo4_android/Osmo4_keystore and /dev/null differ
diff --git a/applications/osmo4_android/build.properties b/applications/osmo4_android/build.properties
deleted file mode 100644 (file)
index b392a8a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-key.store=Osmo4_keystore
-key.alias=Osmo4_androidkey
-key.store.password=SkSlJ404
-key.alias.password=android
\ No newline at end of file
diff --git a/applications/osmo4_android/build.xml b/applications/osmo4_android/build.xml
deleted file mode 100644 (file)
index e65e2d8..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="Osmo4" default="help">
-
-<!-- The local.properties file is created and updated by the 'android'
-     tool.
-     It contains the path to the SDK. It should *NOT* be checked into
-     Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The build.properties file can be created by you and is never touched
-         by the 'android' tool. This is the place to change some of the
-         default property values used by the Ant rules.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="build.properties" />
-
-    <!-- The default.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <property file="default.properties" />
-
-    <!-- Custom Android task to deal with the project target, and import the
-         proper rules.
-         This requires ant 1.6.0 or above. -->
-    <path id="android.antlibs">
-        <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
-        <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
-        <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
-        <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
-       <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
-    </path>
-       
-       <target name="help">
-               <!-- displays starts at col 13
-                     |13                                                              80| -->
-               <echo>Android Ant Build. Available targets:</echo>
-               <echo>   help:      Displays this help.</echo>
-               <echo>   clean:     Removes output files created by other targets.</echo>
-               <echo>   compile:   Compiles project's .java files into .class files.</echo>
-               <echo>   debug:     Builds the application and signs it with a debug key.</echo>
-               <echo>   release:   Builds the application. The generated apk file must be</echo>
-               <echo>              signed before it is published.</echo>
-               <echo>   install:   Installs/reinstalls the debug package onto a running</echo>
-               <echo>              emulator or device.</echo>
-               <echo>              If the application was previously installed, the</echo>
-               <echo>              signatures must match.</echo>
-               <echo>   uninstall: Uninstalls the application from a running emulator or</echo>
-               <echo>              device.</echo>
-       </target>
-
-    <taskdef name="setup"
-        classname="com.android.ant.SetupTask"
-        classpathref="android.antlibs" />
-
-<!-- extension targets. Uncomment the ones where you want to do custom work
-     in between standard targets -->
-<!--
-    <target name="-pre-build">
-    </target>
-    <target name="-pre-compile">
-    </target>
-
-    [This is typically used for code obfuscation.
-     Compiled code location: ${out.classes.absolute.dir}
-     If this is not done in place, override ${out.dex.input.absolute.dir}]
-    <target name="-post-compile">
-    </target>
--->
-
-
-    <!-- Execute the Android Setup task that will setup some properties
-         specific to the target, and import the build rules files.
-
-         The rules file is imported from
-            <SDK>/platforms/<target_platform>/ant/ant_rules_r#.xml
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <setup> task.
-             - customize it to your needs.
-         - Customize the whole script.
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, *after* the <setup> task
-             - disable the import of the rules by changing the setup task
-               below to <setup import="false" />. 
-             - customize to your needs.
-    -->
-    <setup />
-
-</project>
diff --git a/applications/osmo4_android/default.properties b/applications/osmo4_android/default.properties
deleted file mode 100644 (file)
index 9d79b12..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-# 
-# This file must be checked in Version Control Systems.
-# 
-# To customize properties used by the Ant build system use,
-# "build.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-4
diff --git a/applications/osmo4_android/jni/README.txt b/applications/osmo4_android/jni/README.txt
deleted file mode 100644 (file)
index 05c508f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-To build Android version, Please execute the script : 
-../../../build/android/jni/gpac_build_android <PATH_TO_ANDROID_NDK>
diff --git a/applications/osmo4_android/jni/wrapper.cpp b/applications/osmo4_android/jni/wrapper.cpp
deleted file mode 100644 (file)
index 93b0394..0000000
+++ /dev/null
@@ -1,916 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) ENST 2009-
- *                             Authors: Jean Le Feuvre
- *                                     All rights reserved
- *
- *     Created by NGO Van Luyen, Ivica ARSOV / ARTEMIS / Telecom SudParis /Institut TELECOM on Oct, 2010
- *
- *  This file is part of GPAC / Wrapper
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <jni.h>
-
-#include <gpac/terminal.h>
-#include <gpac/thread.h>
-#include <gpac/options.h>
-#include <gpac/modules/service.h>
-#include <gpac/internal/terminal_dev.h>
-#include <gpac/internal/compositor_dev.h>
-
-#include "wrapper.h"
-#include "wrapper_jni.c"
-
-#include <math.h>
-#include <android/log.h>
-
-#define TAG "GPAC_WRAPPER"
-
-#define LOGV(X, Y)  __android_log_print(ANDROID_LOG_VERBOSE, TAG, X, Y)
-#define LOGD(X, Y)  __android_log_print(ANDROID_LOG_DEBUG, TAG, X, Y)
-#define LOGE(X, Y)  __android_log_print(ANDROID_LOG_ERROR, TAG, X, Y)
-#define LOGW(X, Y)  __android_log_print(ANDROID_LOG_WARN, TAG, X, Y)
-#define LOGI(X, Y)  __android_log_print(ANDROID_LOG_INFO, TAG, X, Y)
-#include <pthread.h>
-
-static JavaVM* javaVM = NULL;
-
-static pthread_key_t jni_thread_env_key = 0;
-
-/**
- * This method is called when a pthread is destroyed, so we can delete the JNI env
- */
-static void jni_destroy_env_func(void * env) {
-  LOGI("Destroying a thread with attached data, env=%p.\n", env);
-  JavaEnvTh * jniEnv = (JavaEnvTh *) env;
-  if (jniEnv){
-    /*jniEnv->env->DeleteLocalRef(&jniEnv->cbk_displayMessage);
-    jniEnv->env->DeleteLocalRef(&jniEnv->cbk_onProgress);
-    jniEnv->env->DeleteLocalRef(&jniEnv->cbk_showKeyboard);
-    jniEnv->env->DeleteLocalRef(&jniEnv->cbk_setCaption);
-    jniEnv->env->DeleteLocalRef(&jniEnv->cbk_onLog);*/
-    memset(jniEnv, 0, sizeof(JavaEnvTh));
-    gf_free(jniEnv);
-  }
-  pthread_setspecific(jni_thread_env_key, NULL);
-  if (javaVM)
-    javaVM->DetachCurrentThread();
-}
-
-static int jniRegisterNativeMethods(JNIEnv* env, const char* className,
-    const JNINativeMethod* gMethods, int numMethods)
-{
-    jclass clazz;
-    clazz = env->FindClass(className);
-    if (clazz == NULL) {
-        LOGE("Native registration unable to find class '%s'\n", className);
-        return -1;
-    }
-    if (env->RegisterNatives(clazz, gMethods, numMethods) < 0) {
-        LOGE("RegisterNatives failed for '%s'\n", className);
-        return -1;
-    }
-    return 0;
-}
-
-static JNINativeMethod sMethods[] = {
-     /* name, signature, funcPtr */
-
-    {"createInstance",
-      "(Lcom/gpac/Osmo4/GpacCallback;IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)J",
-      (void*)&Java_com_gpac_Osmo4_GPACInstance_createInstance},
-    {"gpacdisconnect",
-      "()V",
-      (void*)Java_com_gpac_Osmo4_GPACInstance_gpacdisconnect},
-    {"gpacrender",
-      "()V",
-      (void*)Java_com_gpac_Osmo4_GPACInstance_gpacrender},
-    {"gpacresize",
-      "(II)V",
-      (void*)Java_com_gpac_Osmo4_GPACInstance_gpacresize},
-    {"gpacfree",
-      "()V",
-      (void*)Java_com_gpac_Osmo4_GPACInstance_gpacfree},
-    {"gpaceventkeypress",
-      "(IIIII)V",
-      (void*)Java_com_gpac_Osmo4_GPACInstance_gpaceventkeypress},
-    {"gpaceventmousedown",
-      "(FF)V",
-      (void*)Java_com_gpac_Osmo4_GPACInstance_gpaceventmousedown},
-    {"gpaceventmouseup",
-      "(FF)V",
-      (void*)Java_com_gpac_Osmo4_GPACInstance_gpaceventmouseup},
-    {"gpaceventmousemove",
-      "(FF)V",
-      (void*)Java_com_gpac_Osmo4_GPACInstance_gpaceventmousemove},
-    {"setGpacPreference",
-      "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V",
-      (void*)Java_com_gpac_Osmo4_GPACInstance_setGpacPreference},
-      NULL
-};
-
-
-jint JNI_OnUnLoad(JavaVM* vm, void* reserved){
-  LOGI("Deleting library, vm=%p...\n", vm);
-  if (pthread_key_delete(jni_thread_env_key)){
-    LOGW("Failed to delete key jni_thread_env_key jni_thread_env_key=%p\n", jni_thread_env_key);
-  }
-  javaVM = NULL;
-  jni_thread_env_key = NULL;
-}
-
-//---------------------------------------------------------------------------------------------------
-jint JNI_OnLoad(JavaVM* vm, void* reserved){
-        const char * className = "com/gpac/Osmo4/GPACInstance";
-        JNIEnv * env;
-        if (!vm)
-          return -1;
-        if (vm->GetEnv((void**)(&env), JNI_VERSION_1_2) != JNI_OK)
-          return -1;
-        javaVM = vm;
-        LOGI("Registering %s natives\n", className);
-        if (jniRegisterNativeMethods(env, className, sMethods, 9) < 0){
-          LOGE("Failed to register native methods for %s !\n", className);
-          return -1;
-        }
-        LOGI("Registering natives DONE, now registering pthread_keys with destructor=%p\n", &jni_destroy_env_func);
-        int ret = pthread_key_create(&jni_thread_env_key, &jni_destroy_env_func);
-        if (ret){
-          LOGE("Failed to register jni_thread_env_key jni_thread_env_key=%p\n", jni_thread_env_key);
-        }
-        return JNI_VERSION_1_2;
-}
-
-//---------------------------------------------------------------------------------------------------
-//CNativeWrapper
-//-------------------------------
-
-CNativeWrapper::CNativeWrapper(){
-       do_log = 1;
-        m_term = NULL;
-        m_mx = NULL;
-#ifndef GPAC_GUI_ONLY
-       memset(&m_user, 0, sizeof(GF_User));
-       memset(&m_rti, 0, sizeof(GF_SystemRTInfo));
-#endif
-}
-//-------------------------------
-CNativeWrapper::~CNativeWrapper(){
-      debug_log("~CNativeWrapper()");
-      JavaEnvTh * env = getEnv();
-      if (env && env->cbk_obj)
-        env->env->DeleteGlobalRef(env->cbk_obj);
-      Shutdown();
-      debug_log("~CNativeWrapper() : DONE\n");
-}
-//-------------------------------
-void CNativeWrapper::debug_log(const char* msg){
-  LOGV("%s", msg);
-}
-//-------------------------------
-void CNativeWrapper::Shutdown()
-{
-    debug_log("shutdown");
-    if (m_term)
-       gf_term_disconnect(m_term);
-    if (m_mx)
-        gf_mx_del(m_mx);
-    m_mx = NULL;
-#ifndef GPAC_GUI_ONLY
-    if (m_term) {
-               GF_Terminal *t = m_term;
-               m_term = NULL;
-               gf_term_del(t);
-    }
-    if (m_user.config) {
-               gf_cfg_del(m_user.config);
-               m_user.config = NULL;
-    }
-    if (m_user.modules) {
-               gf_modules_del(m_user.modules);
-               m_user.modules = NULL;
-    }
-#endif
-    m_term = NULL;
-    debug_log("shutdown end");
-}
-
-void CNativeWrapper::setJavaEnv(JavaEnvTh * envToSet, JNIEnv *env, jobject callback){
-    assert( envToSet );
-    jclass localRef = env->GetObjectClass(callback);
-    envToSet->env = env;
-    envToSet->javaThreadId = gf_th_id();
-    envToSet->cbk_obj = callback;
-    envToSet->cbk_displayMessage =
-      env->GetMethodID(localRef, "displayMessage", "(Ljava/lang/String;Ljava/lang/String;I)V");
-    envToSet->cbk_onProgress =
-      env->GetMethodID(localRef, "onProgress", "(Ljava/lang/String;II)V");
-    envToSet->cbk_onLog =
-      env->GetMethodID(localRef, "onLog", "(IILjava/lang/String;)V");
-    envToSet->cbk_setCaption =
-      env->GetMethodID(localRef, "setCaption", "(Ljava/lang/String;)V");
-    envToSet->cbk_showKeyboard =
-      env->GetMethodID(localRef, "showKeyboard", "(Z)V");
-    env->DeleteLocalRef(localRef);
-}
-
-static u32 beforeThreadExits(void * param){
-  LOGI("Before Thread exist, detach the JavaVM from Thread for thread %p...\n", gf_th_current());
-  if (javaVM)
-    javaVM->DetachCurrentThread();
-}
-
-JavaEnvTh * CNativeWrapper::getEnv(){
-    JNIEnv *env;
-    JavaEnvTh * javaEnv;
-    if (!javaVM){
-      debug_log("************* No JVM Found ************");
-      return NULL;
-    }
-    javaEnv = (JavaEnvTh*) pthread_getspecific( jni_thread_env_key );
-    if (javaEnv)
-      return javaEnv;
-    javaEnv = (JavaEnvTh *) gf_malloc(sizeof(JavaEnvTh));
-    if (!javaEnv)
-      return NULL;
-    memset(javaEnv, 0, sizeof(JavaEnvTh));
-    javaVM->AttachCurrentThread(&env, NULL);
-    if (!env){
-      LOGE("Attaching to thread did faild for thread id=%d", gf_th_id());
-      gf_free(javaEnv);
-      return NULL;
-    }
-    LOGI("Rebuilding methods for thread %d", gf_th_id());
-    setJavaEnv(javaEnv, env, mainJavaEnv.cbk_obj);
-    if (pthread_setspecific(jni_thread_env_key, javaEnv)){
-      LOGE("Failed to set specific thread data to jni_thread_env_key for thread=%d. No ENV available !", gf_th_id());
-      gf_free(javaEnv);
-      return NULL;
-    }
-    GF_Thread * t;
-    LOGI("Getting current Thread %d...", gf_th_id());
-    t = gf_th_current();
-    LOGI("Getting current Thread DONE = %p, now registering before exit...", t);
-
-    if (GF_OK != gf_register_before_exit_function(gf_th_current(), &beforeThreadExits)){
-      LOGE("Failed to register exit function for thread %p, no javaEnv for current thread.", gf_th_current());
-      //javaVM->DetachCurrentThread();
-      gf_free(javaEnv);
-      javaEnv = NULL;
-    }
-    LOGI("Registering DONE for %d", gf_th_id());
-    return javaEnv;
-}
-
-
-//-------------------------------
-int CNativeWrapper::MessageBox(const char* msg, const char* title, GF_Err status){
-        LOGV("MessageBox start %s", msg);
-       JavaEnvTh * env = getEnv();
-       if (!env || !env->cbk_displayMessage)
-               return 0;
-       env->env->PushLocalFrame(2);
-       jstring tit = env->env->NewStringUTF(title?title:"null");
-       jstring mes = env->env->NewStringUTF(msg?msg:"null");
-       env->env->CallVoidMethod(env->cbk_obj, env->cbk_displayMessage, mes, tit, status);
-       env->env->PopLocalFrame(NULL);
-        LOGV("MessageBox done %s", msg);
-       return 1;
-}
-//-------------------------------
-void CNativeWrapper::DisplayRTI(){
-#ifndef GPAC_GUI_ONLY
-       // display some system informations ?
-#endif
-}
-//-------------------------------
-int CNativeWrapper::Quit(int code){
-
-       Shutdown();
-       // send shutdown request to java
-       return code;
-}
-
-#include <stdio.h>
-
-//-------------------------------
-void CNativeWrapper::on_gpac_log(void *cbk, u32 ll, u32 lm, const char *fmt, va_list list){
-       char szMsg[4096];
-        const char * tag;
-        char unknTag[32];
-        int debug;
-        // We do not want to be flood by mutexes
-        if (ll == GF_LOG_DEBUG && lm == GF_LOG_MUTEX)
-          return;
-        switch (ll){
-          case GF_LOG_DEBUG:
-            debug = ANDROID_LOG_DEBUG;
-            break;
-          case GF_LOG_INFO:
-            debug = ANDROID_LOG_INFO;
-            break;
-          case GF_LOG_WARNING:
-            debug = ANDROID_LOG_WARN;
-            break;
-          case GF_LOG_ERROR:
-            debug = ANDROID_LOG_ERROR;
-            break;
-          default:
-            debug = ANDROID_LOG_INFO;
-        }
-        vsnprintf(szMsg, 4096, fmt, list);
-        CNativeWrapper * self = (CNativeWrapper *) cbk;
-        if (!self)
-          goto displayInAndroidlogs;
-
-        {
-          JavaEnvTh *env = self->getEnv();
-          jstring msg;
-          if (!env || !env->cbk_onLog)
-                goto displayInAndroidlogs;
-         env->env->PushLocalFrame(1);
-          msg = env->env->NewStringUTF(szMsg);
-          env->env->CallVoidMethod(env->cbk_obj, env->cbk_onLog, debug, lm, msg);
-         env->env->PopLocalFrame(NULL);
-          return;
-        }
-displayInAndroidlogs:
-  {
-  /* When no callback is properly set, we use direct logging */
-    switch( lm){
-          case GF_LOG_CORE:
-                tag="GF_LOG_CORE";
-                break;
-        case GF_LOG_CODING:
-                tag="GF_LOG_CODING";
-                break;
-        case GF_LOG_CONTAINER:
-                tag="GF_LOG_CONTAINER";
-                break;
-        case GF_LOG_NETWORK:
-                tag="GF_LOG_NETWORK";
-                break;
-        case GF_LOG_RTP:
-                tag="GF_LOG_RTP";
-                break;
-        case GF_LOG_AUTHOR:
-                tag="GF_LOG_AUTHOR";
-                break;
-        case GF_LOG_SYNC:
-                tag="GF_LOG_SYNC";
-                break;
-        case GF_LOG_CODEC:
-                tag="GF_LOG_CODEC";
-                break;
-        case GF_LOG_PARSER:
-                tag="GF_LOG_PARSER";
-                break;
-        case GF_LOG_MEDIA:
-                tag="GF_LOG_MEDIA";
-                break;
-        case GF_LOG_SCENE:
-                tag="GF_LOG_SCENE";
-                break;
-        case GF_LOG_SCRIPT:
-                tag="GF_LOG_SCRIPT";
-                break;
-        case GF_LOG_INTERACT:
-                tag="GF_LOG_INTERACT";
-                break;
-        case GF_LOG_COMPOSE:
-                tag="GF_LOG_COMPOSE";
-                break;
-        case GF_LOG_CACHE:
-                tag="GF_LOG_CACHE";
-                break;
-        case GF_LOG_MMIO:
-                tag="GF_LOG_MMIO";
-                break;
-        case GF_LOG_RTI:
-                tag="GF_LOG_RTI";
-                break;
-        case GF_LOG_SMIL:
-                tag="GF_LOG_SMIL";
-                break;
-        case GF_LOG_MEMORY:
-                tag="GF_LOG_MEMORY";
-                break;
-        case GF_LOG_AUDIO:
-                tag="GF_LOG_AUDIO";
-                break;
-        case GF_LOG_MODULE:
-                tag="GF_LOG_MODULE";
-                break;
-        case GF_LOG_MUTEX:
-                tag="GF_LOG_MUTEX";
-                break;
-        default:
-            snprintf(unknTag, 32, "GPAC_UNKNOWN[%d]", lm);
-            tag = unknTag;
-    }
-    __android_log_print(debug, tag, szMsg);
-  }
-}
-//-------------------------------
-Bool CNativeWrapper::GPAC_EventProc(void *cbk, GF_Event *evt){
-       if (cbk)
-       {
-               CNativeWrapper* ptr = (CNativeWrapper*)cbk;
-               char msg[4096];
-               msg[0] = 0;
-                LOGD("GPAC_EventProc() Message=%d", evt->type);
-                switch (evt->type){
-                  case GF_EVENT_CLICK:
-                  case GF_EVENT_MOUSEUP:
-                  case GF_EVENT_MOUSEDOWN:
-                  case GF_EVENT_MOUSEOVER:
-                  case GF_EVENT_MOUSEOUT:
-                  case GF_EVENT_MOUSEMOVE:
-                  case GF_EVENT_MOUSEWHEEL:
-                  case GF_EVENT_KEYUP:
-                  case GF_EVENT_KEYDOWN:
-                  case GF_EVENT_LONGKEYPRESS:
-                  case GF_EVENT_TEXTINPUT:
-                    /* We ignore all these events */
-                    break;
-                  case GF_EVENT_MEDIA_BEGIN_SESSION_SETUP:
-                  case GF_EVENT_MEDIA_END_SESSION_SETUP:
-                  case GF_EVENT_MEDIA_DATA_REQUEST:
-                  case GF_EVENT_MEDIA_PLAYABLE:
-                  case GF_EVENT_MEDIA_NOT_PLAYABLE:
-                  case GF_EVENT_MEDIA_DATA_PROGRESS:
-                  case GF_EVENT_MEDIA_END_OF_DATA:
-                  case GF_EVENT_MEDIA_STOP:
-                  case GF_EVENT_MEDIA_ERROR:
-                    LOGD("GPAC_EventProc() Media Event detected = [index=%d]", evt->type - GF_EVENT_MEDIA_BEGIN_SESSION_SETUP);
-                    break;
-                  case GF_EVENT_MESSAGE:
-                  {
-                          ptr->debug_log("GPAC_EventProc start");
-                          if ( evt->message.message )
-                          {
-                                  strcat(msg, evt->message.message);
-                                  strcat(msg, ": ");
-                          }
-                          strcat(msg, gf_error_to_string(evt->message.error));
-
-                          ptr->debug_log(msg);
-                          ptr->MessageBox(msg, evt->message.service ? evt->message.service : "GF_EVENT_MESSAGE", evt->message.error);
-                          ptr->debug_log("GPAC_EventProc end");
-                  };
-                  break;
-                  case GF_EVENT_CONNECT:
-                    if (evt->connect.is_connected)
-                      ptr->MessageBox("Connected", "Connected to scene", GF_OK);
-                    else
-                      ptr->MessageBox("Disconnected", "Disconnected from scene.", GF_OK);
-                    break;
-                  case GF_EVENT_PROGRESS:
-                  {
-                          const char * szTitle;;
-                          if (evt->progress.progress_type==0)
-                            szTitle = "Buffering";
-                          else if (evt->progress.progress_type==1)
-                            szTitle = "Downloading...";
-                          else if (evt->progress.progress_type==2)
-                            szTitle = "Import ";
-                          else
-                            szTitle = "Unknown Progress Event";
-                          ptr->Osmo4_progress_cbk(ptr, szTitle, evt->progress.done, evt->progress.total);
-                          gf_set_progress(szTitle, evt->progress.done, evt->progress.total);
-                  }
-                  break;
-                  case GF_EVENT_TEXT_EDITING_START:
-                  case GF_EVENT_TEXT_EDITING_END:
-                  {
-                      JavaEnvTh * env = ptr->getEnv();
-                      if (!env || !env->cbk_showKeyboard)
-                              return 0;
-                      LOGI("Needs to display/hide the Virtual Keyboard (%d)", evt->type);
-                      env->env->CallVoidMethod(env->cbk_obj, env->cbk_showKeyboard, GF_EVENT_TEXT_EDITING_START == evt->type);
-                      LOGV("Done showing virtual keyboard (%d)", evt->type);
-                  }
-                    break;
-                  case GF_EVENT_EOS:
-                    LOGI("EOS Reached (%d)", evt->type);
-                    break;
-                  case GF_EVENT_DISCONNECT:
-                    /* FIXME : not sure about this behaviour */
-                    if (ptr)
-                      ptr->disconnect();
-                    break;
-                  case GF_EVENT_NAVIGATE:
-                                       ptr->navigate( evt);
-                                       break;
-                  default:
-                    LOGI("Unknown Message %d", evt->type);
-                }
-       }
-       return 0;
-}
-
-void CNativeWrapper::navigate( GF_Event* evt)
-{      
-       if (gf_term_is_supported_url(m_term, evt->navigate.to_url, 1, 1)) 
-       {
-               gf_term_navigate_to(m_term, evt->navigate.to_url);
-       } 
-}
-
-void CNativeWrapper::progress_cbk(const char *title, u64 done, u64 total){
-        JavaEnvTh *env = getEnv();
-        if (!env || !env->cbk_onProgress)
-                return;
-        debug_log("Osmo4_progress_cbk start");
-       env->env->PushLocalFrame(1);
-        jstring js = env->env->NewStringUTF(title);
-        env->env->CallVoidMethod(env->cbk_obj, env->cbk_onProgress, js, done, total);
-       env->env->PopLocalFrame(NULL);
-        debug_log("Osmo4_progress_cbk end");
-}
-
-
-//-------------------------------
-void CNativeWrapper::Osmo4_progress_cbk(const void *usr, const char *title, u64 done, u64 total){
-       if (!usr)
-               return;
-       CNativeWrapper * self = (CNativeWrapper *) usr;
-       self->progress_cbk(title, done, total);
-}
-//-------------------------------
-void CNativeWrapper::SetupLogs(){
-       const char *opt;
-       debug_log("SetupLogs()");
-
-       gf_mx_p(m_mx);
-
-       u32 ll = gf_log_parse_level( gf_cfg_get_key(m_user.config, "General", "LogLevel") );
-       gf_log_set_level(ll);
-       u32 lt = gf_log_parse_tools( gf_cfg_get_key(m_user.config, "General", "LogTools") );
-       gf_log_set_tools(lt);
-
-       gf_log_set_callback(this, on_gpac_log);
-       gf_mx_v(m_mx);
-
-       GF_LOG(GF_LOG_INFO, GF_LOG_CORE, ("Osmo4 logs initialized\n"));
-       /* Test for JNI invocations, should work properly
-       int k;
-       for (k = 0 ; k < 512; k++){
-               GF_LOG(GF_LOG_INFO, GF_LOG_CORE, ("Message %d\n", k));
-       }*/
-}
-//-------------------------------
-// dir should end with /
-int CNativeWrapper::init(JNIEnv * env, void * bitmap, jobject * callback, int width, int height, const char * cfg_dir, const char * modules_dir, const char * cache_dir, const char * font_dir, const char * urlToLoad){
-        LOGI("Initializing GPAC with URL=%s...", urlToLoad);
-       strcpy(m_cfg_dir, cfg_dir);
-       strcpy(m_modules_dir, modules_dir);
-       strcpy(m_cache_dir, cache_dir);
-       strcpy(m_font_dir, font_dir);
-
-       char m_cfg_filename[GF_MAX_PATH];
-       strcpy(m_cfg_filename, m_cfg_dir);
-       strcat(m_cfg_filename, "GPAC.cfg");
-
-       int m_Width = width;
-       int m_Height = height;
-
-       int first_launch = 0;
-       const char *opt;
-
-       m_window = env;
-       m_session = bitmap;
-        setJavaEnv(&mainJavaEnv, env, env->NewGlobalRef(*callback));
-        if (pthread_setspecific( jni_thread_env_key, &mainJavaEnv)){
-          LOGE("Failed to set specific thread data to jni_thread_env_key=%p for main thread !", jni_thread_env_key);
-        }
-
-       m_mx = gf_mx_new("Osmo4");
-
-       //load config file
-        LOGI("Loading User Config %s...", "GPAC.cfg");
-       m_user.config = gf_cfg_force_new(cfg_dir, "GPAC.cfg");
-       SetupLogs();
-       gf_set_progress_callback(this, Osmo4_progress_cbk);
-
-       opt = gf_cfg_get_key(m_user.config, "General", "ModulesDirectory");
-       if (!opt) {
-                FILE * fstart;
-                char msg[256];
-                LOGI("First launch, initializing new Config %s...", "GPAC.cfg");
-               /*hardcode module directory*/
-               gf_cfg_set_key(m_user.config, "Downloader", "CleanCache", "yes");
-               /*startup file*/
-               snprintf(msg, 256, "%sgui/gui.bt", cfg_dir);
-                fstart = fopen(msg, "r");
-                if (fstart){
-                  fclose(fstart);
-                  gf_cfg_set_key(m_user.config, "General", "StartupFile", msg);
-                } else {
-                  gf_cfg_set_key(m_user.config, "General", "#StartupFile", msg);
-                }
-               gf_cfg_set_key(m_user.config, "GUI", "UnhideControlPlayer", "1");
-               /*setup UDP traffic autodetect*/
-               gf_cfg_set_key(m_user.config, "Network", "AutoReconfigUDP", "yes");
-               gf_cfg_set_key(m_user.config, "Network", "UDPTimeout", "10000");
-               gf_cfg_set_key(m_user.config, "Network", "BufferLength", "3000");
-               gf_cfg_set_key(m_user.config, "Compositor", "TextureTextMode", "Default");
-               //gf_cfg_set_key(m_user.config, "Compositor", "FrameRate", "30");
-               gf_cfg_set_key(m_user.config, "Audio", "ForceConfig", "no");
-               gf_cfg_set_key(m_user.config, "Audio", "NumBuffers", "1");
-               gf_cfg_set_key(m_user.config, "FontEngine", "FontReader", "ft_font");
-       }
-       /* All of this has to be done for every instance */
-       gf_cfg_set_key(m_user.config, "General", "ModulesDirectory", modules_dir ? modules_dir : GPAC_MODULES_DIR);
-        gf_cfg_set_key(m_user.config, "General", "CacheDirectory", cache_dir ? cache_dir : GPAC_CACHE_DIR);
-        gf_cfg_set_key(m_user.config, "General", "LastWorkingDir", cfg_dir);
-        gf_cfg_set_key(m_user.config, "FontEngine", "FontDirectory", GPAC_FONT_DIR);
-        gf_cfg_set_key(m_user.config, "Video", "DriverName", "Android Video Output");
-        gf_cfg_set_key(m_user.config, "Audio", "DriverName", "Android Audio Output");
-
-       opt = gf_cfg_get_key(m_user.config, "General", "ModulesDirectory");
-        LOGI("loading modules in directory %s...", opt);
-       m_user.modules = gf_modules_new(opt, m_user.config);
-       if (!m_user.modules || !gf_modules_get_count(m_user.modules)) {
-                LOGE("No modules found in directory %s !", opt);
-               if (m_user.modules)
-                  gf_modules_del(m_user.modules);
-               gf_cfg_del(m_user.config);
-                m_user.config = NULL;
-               return Quit(KErrGeneral);
-       }
-
-       /*we don't thread the visual compositor to be able to minimize the app and still have audio running*/
-       m_user.init_flags = GF_TERM_NO_COMPOSITOR_THREAD | GF_TERM_NO_REGULATION;
-       //m_user.init_flags |= GF_TERM_NO_AUDIO;
-       m_user.opaque = this;
-
-       m_user.os_window_handler = m_window;
-       m_user.os_display = m_session;
-        m_user.EventProc = GPAC_EventProc;
-        if (!javaVM){
-            LOGE("NO JAVA VM FOUND, m_user=%p !!!!\n", &m_user);
-            return Quit(KErrGeneral);
-        }
-
-        LOGD("Loading GPAC terminal, m_user=%p...", &m_user);
-       m_term = gf_term_new(&m_user);
-       if (!m_term) {
-                LOGE("Cannot load GPAC Terminal with m_user=%p", m_user);
-               MessageBox("Cannot load GPAC terminal", "Fatal Error", GF_SERVICE_ERROR);
-               gf_modules_del(m_user.modules);
-                m_user.modules = NULL;
-               gf_cfg_del(m_user.config);
-                m_user.config = NULL;
-               return Quit(KErrGeneral);
-       }
-
-       //setAudioEnvironment(javaVM);
-
-        LOGD("Setting term size m_user=%p...", &m_user);
-       gf_term_set_size(m_term, m_Width, m_Height);
-
-       opt = gf_cfg_get_key(m_user.config, "General", "StartupFile");
-       LOGD("File loaded at startup=%s.", opt);
-
-        if (!urlToLoad)
-          urlToLoad = opt;
-       if (urlToLoad){
-          LOGI("Connecting to %s...", urlToLoad);
-          gf_term_connect(m_term, urlToLoad);
-        }
-        debug_log("init end");
-       LOGD("Saving config file %s...\n", m_cfg_filename);
-        gf_cfg_save(m_user.config);
-        LOGI("Initialization complete, config file saved as %s.\n", m_cfg_filename);   
-       
-        return 0;
-}
-//-------------------------------
-int CNativeWrapper::connect(const char *url){
-        if (m_term){
-          debug_log("Starting to connect ...");
-          gf_term_connect_from_time(m_term, url, 0, false);
-          debug_log("connected ...");
-        }
-}
-
-void CNativeWrapper::setGpacPreference( const char * category, const char * name, const char * value)
-{
-  if (m_user.config){
-    gf_cfg_set_key(m_user.config, category, name, value);
-    gf_cfg_save(m_user.config);
-  }
-}
-
-//-----------------------------------------------------
-void CNativeWrapper::disconnect(){
-        if (m_term){
-          debug_log("disconnecting");
-          gf_term_disconnect(m_term);
-          debug_log("disconnected ...");
-        }
-}
-//-----------------------------------------------------
-void CNativeWrapper::step(void * env, void * bitmap){
-       m_window = env;
-       m_session = bitmap;
-       //debug_log("Step ...");
-       if (!m_term){
-               debug_log("step(): No m_term found.");
-                return;
-        } else
-          if (!m_term->compositor)
-               debug_log("step(): No compositor found.");
-          else if (!m_term->compositor->video_out)
-               debug_log("step(): No video_out found");
-          else if (!m_term->compositor->video_out->Setup)
-               debug_log("step(): No video_out->Setup found");
-          else {
-                //debug_log("step(): gf_term_process_step : start()");
-                m_term->compositor->frame_draw_type = GF_SC_DRAW_FRAME;
-                gf_term_process_step(m_term);
-                //debug_log("step(): gf_term_process_step : end()");
-       }
-}
-
-//-----------------------------------------------------
-void CNativeWrapper::setAudioEnvironment(JavaVM* javaVM){
-        if (!m_term){
-            debug_log("setAudioEnvironment(): no m_term found.");
-            return;
-        }
-       debug_log("setAudioEnvironment start");
-       m_term->compositor->audio_renderer->audio_out->Setup(m_term->compositor->audio_renderer->audio_out, javaVM, 0, 0);
-        debug_log("setAudioEnvironment end");
-}
-//-----------------------------------------------------
-void CNativeWrapper::resize(int w, int h){
-        if (!m_term)
-          return;
-        debug_log("resize start");
-       gf_term_set_size(m_term, w, h);
-        debug_log("resize end");
-}
-//-----------------------------------------------------
-void CNativeWrapper::onMouseDown(float x, float y){
-        if (!m_term)
-          return;
-        debug_log("onMouseDown start");
-       //char msg[100];
-       //sprintf(msg, "onMousedown x=%f, y=%f", x, y );
-       //debug_log(msg);
-
-       GF_Event evt;
-       evt.type = GF_EVENT_MOUSEDOWN;
-       evt.mouse.button = GF_MOUSE_LEFT;
-       evt.mouse.x = x;
-       evt.mouse.y = y;
-
-       int ret = gf_term_user_event(m_term, &evt);
-        debug_log("onMouseDown end");
-}
-//-----------------------------------------------------
-void CNativeWrapper::onMouseUp(float x, float y){
-        if (!m_term)
-          return;
-        debug_log("onMouseUp start");
-       //char msg[100];
-       //sprintf(msg, "onMouseUp x=%f, y=%f", x, y );
-       //debug_log(msg);
-
-       GF_Event evt;
-       evt.type = GF_EVENT_MOUSEUP;
-       evt.mouse.button = GF_MOUSE_LEFT;
-       evt.mouse.x = x;
-       evt.mouse.y = y;
-
-       int ret = gf_term_user_event(m_term, &evt);
-        debug_log("onMouseUp end");
-}
-//-----------------------------------------------------
-void CNativeWrapper::onMouseMove(float x, float y){
-       if (!m_term)
-          return;
-       GF_Event evt;
-       evt.type = GF_EVENT_MOUSEMOVE;
-       evt.mouse.button = GF_MOUSE_LEFT;
-       evt.mouse.x = x;
-       evt.mouse.y = y;
-
-       int ret = gf_term_user_event(m_term, &evt);
-}
-//-----------------------------------------------------
-void CNativeWrapper::onKeyPress(int keycode, int rawkeycode, int up, int flag, int unicode){
-        if (!m_term)
-          return;
-        debug_log("onKeyPress start");
-       GF_Event evt;
-        memset(&evt, 0, sizeof(GF_Event));
-       if (up == 0) evt.type = GF_EVENT_KEYUP;
-       else evt.type = GF_EVENT_KEYDOWN;
-
-       evt.key.flags = 0;
-       evt.key.hw_code = rawkeycode;
-
-       translate_key(keycode, &evt.key);
-       //evt.key.key_code = GF_KEY_A;
-       int ret = gf_term_user_event(m_term, &evt);
-
-        if (evt.type == GF_EVENT_KEYUP && unicode){
-          memset(&evt, 0, sizeof(GF_Event));
-          evt.type = GF_EVENT_TEXTINPUT;
-          evt.character.unicode_char = unicode;
-          ret = gf_term_user_event(m_term, &evt);
-        }
-}
-//-----------------------------------------------------
-void CNativeWrapper::translate_key(ANDROID_KEYCODE keycode, GF_EventKey *evt){
-       evt->flags = 0;
-       switch (keycode) {
-       case ANDROID_KEYCODE_BACK: evt->key_code = GF_KEY_BACKSPACE; break;
-       case ANDROID_KEYCODE_TAB: evt->key_code = GF_KEY_TAB; break;
-       case ANDROID_KEYCODE_CLEAR: evt->key_code = GF_KEY_CLEAR; break;
-       case ANDROID_KEYCODE_ENTER: evt->key_code = GF_KEY_ENTER; break;
-       case ANDROID_KEYCODE_SHIFT_LEFT: evt->key_code = GF_KEY_SHIFT; break;
-       case ANDROID_KEYCODE_SHIFT_RIGHT: evt->key_code = GF_KEY_SHIFT; break;
-       case ANDROID_KEYCODE_ALT_LEFT: evt->key_code = GF_KEY_ALT; break;
-       case ANDROID_KEYCODE_ALT_RIGHT: evt->key_code = GF_KEY_ALT; break;
-       case ANDROID_KEYCODE_SPACE: evt->key_code = GF_KEY_SPACE; break;
-       case ANDROID_KEYCODE_HOME: evt->key_code = GF_KEY_HOME; break;
-       case ANDROID_KEYCODE_DPAD_LEFT: evt->key_code = GF_KEY_LEFT; break;
-       case ANDROID_KEYCODE_DPAD_UP: evt->key_code = GF_KEY_UP; break;
-       case ANDROID_KEYCODE_DPAD_RIGHT: evt->key_code = GF_KEY_RIGHT; break;
-       case ANDROID_KEYCODE_DPAD_DOWN: evt->key_code = GF_KEY_DOWN; break;
-       case ANDROID_KEYCODE_DEL: evt->key_code = GF_KEY_DEL; break;
-       case ANDROID_KEYCODE_0:
-               evt->key_code = GF_KEY_0;
-               evt->flags = GF_KEY_EXT_NUMPAD;
-               break;
-       case ANDROID_KEYCODE_1:
-               evt->key_code = GF_KEY_1;
-               evt->flags = GF_KEY_EXT_NUMPAD;
-               break;
-       case ANDROID_KEYCODE_2:
-               evt->key_code = GF_KEY_2;
-               evt->flags = GF_KEY_EXT_NUMPAD;
-               break;
-       case ANDROID_KEYCODE_3:
-               evt->key_code = GF_KEY_3;
-               evt->flags = GF_KEY_EXT_NUMPAD;
-               break;
-       case ANDROID_KEYCODE_4:
-               evt->key_code = GF_KEY_4;
-               evt->flags = GF_KEY_EXT_NUMPAD;
-               break;
-       case ANDROID_KEYCODE_5:
-               evt->key_code = GF_KEY_5;
-               evt->flags = GF_KEY_EXT_NUMPAD;
-               break;
-       case ANDROID_KEYCODE_6:
-               evt->key_code = GF_KEY_6;
-               evt->flags = GF_KEY_EXT_NUMPAD;
-               break;
-       case ANDROID_KEYCODE_7:
-               evt->key_code = GF_KEY_7;
-               evt->flags = GF_KEY_EXT_NUMPAD;
-               break;
-       case ANDROID_KEYCODE_8:
-               evt->key_code = GF_KEY_8;
-               evt->flags = GF_KEY_EXT_NUMPAD;
-               break;
-       case ANDROID_KEYCODE_9:
-               evt->key_code = GF_KEY_9;
-               evt->flags = GF_KEY_EXT_NUMPAD;
-               break;
-       /*thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) */
-       /* VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */
-       default:
-               if ((keycode>=ANDROID_KEYCODE_A) && (keycode<=ANDROID_KEYCODE_Z)){
-                  evt->key_code = GF_KEY_A + keycode - ANDROID_KEYCODE_A;
-                } else {
-                  evt->key_code = GF_KEY_UNIDENTIFIED;
-                }
-               break;
-       }
-       evt->hw_code = evt->key_code;
-}
-
-//---------------------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------------------
diff --git a/applications/osmo4_android/jni/wrapper.h b/applications/osmo4_android/jni/wrapper.h
deleted file mode 100644 (file)
index 1cd231d..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) ENST 2009-
- *                             Authors: Jean Le Feuvre
- *                                     All rights reserved
- *
- *     Created by NGO Van Luyen, Ivica ARSOV / ARTEMIS / Telecom SudParis /Institut TELECOM on Oct, 2010
- *
- *  This file is part of GPAC / Wrapper
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <jni.h>
-
-#include <gpac/terminal.h>
-#include <gpac/thread.h>
-#include <gpac/options.h>
-#include <gpac/modules/service.h>
-
-//#define              MAX_PATH        255
-
-#define                KErrGeneral     1
-//#define              GPAC_CFG_DIR    "/data/osmo/"
-#define                GPAC_CFG_DIR    m_cfg_dir
-//#define              GPAC_MODULES_DIR "/data/osmo/modules/"
-#define                GPAC_MODULES_DIR m_modules_dir
-//#define              GPAC_MODULES_PATH "/data/osmo/modules/"
-#define                GPAC_MODULES_PATH m_modules_dir
-//#define              GPAC_CACHE_DIR "/data/osmo/cache/"
-#define                GPAC_CACHE_DIR m_cache_dir
-//#define              GPAC_LOG_FILE "/data/osmo/gpac_logs.txt"
-#define                GPAC_LOG_FILE m_log_filename
-//#define              GPAC_FONT_DIR "/system/fonts/"
-#define                GPAC_FONT_DIR m_font_dir
-
-#define                DEBUG_MODE      1
-//#define              DEBUG_FILE      "/data/osmo/osmo_debug.txt"
-#define                DEBUG_FILE      m_debug_filename
-
-// keyboard code
-#define ANDROID_KEYCODE                int
-#define ANDROID_KEYCODE_0      7
-#define ANDROID_KEYCODE_1      8
-#define ANDROID_KEYCODE_2      9
-#define ANDROID_KEYCODE_3      10
-#define ANDROID_KEYCODE_4      11
-#define ANDROID_KEYCODE_5      12
-#define ANDROID_KEYCODE_6      13
-#define ANDROID_KEYCODE_7      14
-#define ANDROID_KEYCODE_8      15
-#define ANDROID_KEYCODE_9      16
-#define ANDROID_KEYCODE_A      29
-#define ANDROID_KEYCODE_B      30
-#define ANDROID_KEYCODE_C      31
-#define ANDROID_KEYCODE_D      32
-#define ANDROID_KEYCODE_E      33
-#define ANDROID_KEYCODE_F      34
-#define ANDROID_KEYCODE_G      35
-#define ANDROID_KEYCODE_H      36
-#define ANDROID_KEYCODE_I      37
-#define ANDROID_KEYCODE_J      38
-#define ANDROID_KEYCODE_K      39
-#define ANDROID_KEYCODE_L      40
-#define ANDROID_KEYCODE_M      41
-#define ANDROID_KEYCODE_N      42
-#define ANDROID_KEYCODE_O      43
-#define ANDROID_KEYCODE_P      44
-#define ANDROID_KEYCODE_Q      45
-#define ANDROID_KEYCODE_R      46
-#define ANDROID_KEYCODE_S      47
-#define ANDROID_KEYCODE_T      48
-#define ANDROID_KEYCODE_U      49
-#define ANDROID_KEYCODE_V      50
-#define ANDROID_KEYCODE_W      51
-#define ANDROID_KEYCODE_X      52
-#define ANDROID_KEYCODE_Y      53
-#define ANDROID_KEYCODE_Z      54
-#define ANDROID_KEYCODE_ALT_LEFT       57
-#define ANDROID_KEYCODE_ALT_RIGHT      58
-#define ANDROID_KEYCODE_AT             77
-#define ANDROID_KEYCODE_BACK           4
-#define ANDROID_KEYCODE_BACKSLASH      73
-#define ANDROID_KEYCODE_CALL           5
-#define ANDROID_KEYCODE_CAMERA         27
-#define ANDROID_KEYCODE_CLEAR          28
-#define ANDROID_KEYCODE_COMMA          55
-#define ANDROID_KEYCODE_DEL            67
-#define ANDROID_KEYCODE_DPAD_CENTER    23
-#define ANDROID_KEYCODE_DPAD_DOWN      20
-#define ANDROID_KEYCODE_DPAD_LEFT      21
-#define ANDROID_KEYCODE_DPAD_RIGHT     22
-#define ANDROID_KEYCODE_DPAD_UP                19
-#define ANDROID_KEYCODE_ENDCALL                6
-#define ANDROID_KEYCODE_ENTER          66
-#define ANDROID_KEYCODE_ENVELOPE       65
-#define ANDROID_KEYCODE_EQUALS         70
-#define ANDROID_KEYCODE_EXPLORER       64
-#define ANDROID_KEYCODE_FOCUS          80
-#define ANDROID_KEYCODE_GRAVE          68
-#define ANDROID_KEYCODE_HEADSETHOOK    79
-#define ANDROID_KEYCODE_HOME           3
-#define ANDROID_KEYCODE_LEFT_BRACKET   71
-#define ANDROID_KEYCODE_MEDIA_FAST_FORWARD     90
-#define ANDROID_KEYCODE_MEDIA_NEXT     87
-#define ANDROID_KEYCODE_MEDIA_PLAY_PAUSE       85
-#define ANDROID_KEYCODE_MEDIA_PREVIOUS 88
-#define ANDROID_KEYCODE_MEDIA_REWIND   89
-#define ANDROID_KEYCODE_MEDIA_STOP     86
-#define ANDROID_KEYCODE_MENU           82
-#define ANDROID_KEYCODE_MINUS          69
-#define ANDROID_KEYCODE_MUTE           91
-#define ANDROID_KEYCODE_NUM            78
-#define ANDROID_KEYCODE_PLUS           81
-#define ANDROID_KEYCODE_POWER          26
-#define ANDROID_KEYCODE_RIGHT_BRACKET  72
-#define ANDROID_KEYCODE_SEARCH         84
-#define ANDROID_KEYCODE_SEMICOLON      74
-#define ANDROID_KEYCODE_SHIFT_LEFT     59
-#define ANDROID_KEYCODE_SHIFT_RIGHT    60
-#define ANDROID_KEYCODE_SLASH          76
-#define ANDROID_KEYCODE_SOFT_LEFT      1
-#define ANDROID_KEYCODE_SOFT_RIGHT     2
-#define ANDROID_KEYCODE_SPACE          62
-#define ANDROID_KEYCODE_STAR           17
-#define ANDROID_KEYCODE_SYM            63
-#define ANDROID_KEYCODE_TAB            61
-
-#define ANDROID_KEYCODE_UNKWON         -1
-
-#include <jni.h>
-
-typedef struct _JavaEnvTh {
-  JNIEnv * env;
-  u32 javaThreadId;
-  jobject cbk_obj;
-  jmethodID cbk_displayMessage;
-  jmethodID cbk_onProgress;
-  jmethodID cbk_showKeyboard;
-  jmethodID cbk_setCaption;
-  jmethodID cbk_onLog;
-} JavaEnvTh;
-
-
-//---------------------------------------------------------------------------------------------------
-//---------------------------------------------------------------------------------------------------
-class CNativeWrapper{
-
-       private:
-               void* m_window;
-               void* m_session;
-
-               GF_User *GetUser() { return &m_user; }
-               GF_Terminal *m_term;
-
-               /*
-                * Callback management
-                */
-                JavaEnvTh mainJavaEnv;
-
-               GF_Mutex *m_mx;
-               GF_User m_user;
-               GF_SystemRTInfo m_rti;
-
-               int     do_log;
-       private:
-               char m_cfg_dir[GF_MAX_PATH];
-               char m_modules_dir[GF_MAX_PATH];
-               char m_cache_dir[GF_MAX_PATH];
-               char m_font_dir[GF_MAX_PATH];
-                void setJavaEnv(JavaEnvTh * envToSet, JNIEnv *env, jobject callback);
-       private:
-               void SetupLogs();
-               void Shutdown();
-               void DisplayRTI();
-       protected:
-               JavaEnvTh * getEnv();
-
-       public:
-               CNativeWrapper();
-               ~CNativeWrapper();
-               int init(JNIEnv * env, void * bitmap, jobject * callback, int width, int height, const char * cfg_dir, const char * modules_dir, const char * cache_dir, const char * font_dir, const char * urlToLoad);
-
-               int connect(const char *url);
-               void disconnect();
-               void step(void * env, void * bitmap);
-               void resize(int w, int h);
-               void setAudioEnvironment(JavaVM* javaVM);
-
-               void onMouseDown(float x, float y);
-               void onMouseUp(float x, float y);
-               void onMouseMove(float x, float y);
-               void onKeyPress(int keycode, int rawkeycode, int up, int flag, int unicode);
-               void translate_key(ANDROID_KEYCODE keycode, GF_EventKey *evt);
-               void navigate( GF_Event* evt);
-                void setGpacPreference( const char * category, const char * name, const char * value);
-       public:
-               int MessageBox(const char* msg, const char* title, GF_Err status);
-               int Quit(int code);
-               GF_Config *create_default_config(char *file_path, char *file_name);
-
-               static void on_gpac_log(void *cbk, u32 ll, u32 lm, const char *fmt, va_list list);
-               static Bool GPAC_EventProc(void *cbk, GF_Event *evt);
-                void progress_cbk(const char *title, u64 done, u64 total);
-               static void Osmo4_progress_cbk(const void *usr, const char *title, u64 done, u64 total);
-
-       private:
-#ifdef DEBUG_MODE
-               FILE    *debug_f;
-#endif
-               void debug_log(const char* msg);
-
-};
-
diff --git a/applications/osmo4_android/jni/wrapper_jni.c b/applications/osmo4_android/jni/wrapper_jni.c
deleted file mode 100644 (file)
index e9bcd0b..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-//#include "wrapper_jni.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <android/log.h>
-
-#define jniTAG "WRAPPER_JNI"
-
-#define jniLOGV(X)  __android_log_print(ANDROID_LOG_VERBOSE, jniTAG, X)
-#define jniLOGI(X)  __android_log_print(ANDROID_LOG_INFO, jniTAG, X)
-#define jniLOGE(X)  __android_log_print(ANDROID_LOG_ERROR, jniTAG, X)
-
-#define CAST_HANDLE(wr) jclass c = env->GetObjectClass(obj);\
-                        if (!c) return;\
-                        jfieldID fid = env->GetFieldID(c, "handle", "J");\
-                        if (!fid){\
-                          __android_log_print(ANDROID_LOG_ERROR, jniTAG, "No Field ID, ERROR");\
-                          return;\
-                        }\
-                        jlong h = env->GetLongField(obj, fid);\
-                        CNativeWrapper* wr = (CNativeWrapper*) h;
-//                        __android_log_print(ANDROID_LOG_VERBOSE, jniTAG, "Handle = %p", wr);
-
-/*
- * Class:     com_gpac_Osmo4_GPACInstance
- * Method:    createInstance
- * Signature: (Lcom/gpac/Osmo4/GpacCallback;IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
- */
-JNIEXPORT jlong JNICALL Java_com_gpac_Osmo4_GPACInstance_createInstance(JNIEnv * env, jclass obj, jobject callback, jint width, jint height, jstring cfg_dir, jstring modules_dir, jstring cache_dir, jstring font_dir, jstring url_to_open)
-{
-        jboolean isCopy;
-        const char * s1 = env->GetStringUTFChars(cfg_dir, &isCopy);
-        const char * s2 = env->GetStringUTFChars(modules_dir, &isCopy);
-        const char * s3 = env->GetStringUTFChars(cache_dir, &isCopy);
-        const char * s4 = env->GetStringUTFChars(font_dir, &isCopy);
-        const char * s5 = NULL;
-        if (url_to_open)
-          s5 = env->GetStringUTFChars(url_to_open, &isCopy);
-        else
-          s5 = NULL;
-        CNativeWrapper * gpac_obj = new CNativeWrapper();
-        if (gpac_obj){
-          int w = width;
-          int h = height;
-          jniLOGI("Calling gpac_obj->init()...");
-          if (gpac_obj->init(env, NULL, &callback,
-                              w, h,
-                              s1, s2, s3, s4, s5)){
-            jniLOGE("FAILED to init(), return code not 0");
-            delete gpac_obj;
-            gpac_obj = NULL;
-          }
-        } else {
-          jniLOGE("FAILED to create new CNativeWrapper() : not enough memory ?");
-        }
-
-        env->ReleaseStringUTFChars(cfg_dir, s1);
-        env->ReleaseStringUTFChars(modules_dir, s2);
-        env->ReleaseStringUTFChars(cache_dir, s3);
-        env->ReleaseStringUTFChars(font_dir, s4);
-        if (s5)
-          env->ReleaseStringUTFChars(font_dir, s5);
-        __android_log_print(ANDROID_LOG_VERBOSE, jniTAG, "Returned Handle = %p", gpac_obj);
-        return (jlong) gpac_obj;
-}
-//-----------------------------------
-JNIEXPORT void JNICALL Java_com_gpac_Osmo4_GPACInstance_gpacconnect(JNIEnv * env, jobject obj, jstring fileName)
-{
-        CAST_HANDLE(wr);
-        jniLOGV("connect::start");
-        if (!wr){
-          jniLOGV("connect::end : aborted");
-          return;
-        }
-        jboolean isCopy;
-        const char * cFileName = env->GetStringUTFChars(fileName, &isCopy);
-
-        wr->connect(cFileName);
-
-        env->ReleaseStringUTFChars(fileName, cFileName);
-        jniLOGV("connect::end");
-}
-//-----------------------------------
-JNIEXPORT void JNICALL Java_com_gpac_Osmo4_GPACInstance_gpacdisconnect(JNIEnv * env, jobject obj){
-        CAST_HANDLE(wr);
-        jniLOGV("disconnect::start");
-        if (wr)
-          wr->disconnect();
-        jniLOGV("disconnect::end");
-}
-//-----------------------------------
-JNIEXPORT void JNICALL Java_com_gpac_Osmo4_GPACInstance_gpacfree(JNIEnv * env, jobject obj)
-{
-        CAST_HANDLE(wr);
-        jniLOGV("free::start");
-        if (wr)
-          delete wr;
-        jniLOGV("free::end");
-}
-//-----------------------------------
-JNIEXPORT void JNICALL Java_com_gpac_Osmo4_GPACInstance_gpacrender (JNIEnv * env, jobject obj)
-{
-        CAST_HANDLE(wr);
-        //jniLOGV("render::start");
-        if (wr)
-          wr->step(env, NULL);
-        //jniLOGV("render::end");
-}
-//-----------------------------------
-JNIEXPORT void JNICALL Java_com_gpac_Osmo4_GPACInstance_gpacresize (JNIEnv * env, jobject obj, jint width, jint height)
-{
-        CAST_HANDLE(wr);
-        jniLOGV("resize::start");
-        if (wr)
-          wr->resize(width, height);
-        jniLOGV("resize::end");
-}
-//-----------------------------------
-JNIEXPORT void JNICALL Java_com_gpac_Osmo4_GPACInstance_gpaceventmousedown(JNIEnv * env, jobject obj, jfloat x, jfloat y){
-        CAST_HANDLE(wr);
-        jniLOGV("mouseDown::start");
-        if (wr)
-          wr->onMouseDown(x, y);
-        jniLOGV("mouseDown::end");
-}
-//-----------------------------------
-JNIEXPORT void JNICALL Java_com_gpac_Osmo4_GPACInstance_gpaceventmouseup(JNIEnv * env, jobject obj, jfloat x, jfloat y){
-        CAST_HANDLE(wr);
-        jniLOGV("mouseUp::start");
-        if (wr)
-          wr->onMouseUp(x, y);
-        jniLOGV("mouseUp::end");
-}
-//-----------------------------------
-JNIEXPORT void JNICALL Java_com_gpac_Osmo4_GPACInstance_gpaceventmousemove(JNIEnv * env, jobject obj, jfloat x, jfloat y){
-        CAST_HANDLE(wr);
-        jniLOGV("mouseMouv::start");
-        if (wr)
-          wr->onMouseMove(x, y);
-        jniLOGV("mouseMouv::end");
-}
-//-----------------------------------
-JNIEXPORT void JNICALL Java_com_gpac_Osmo4_GPACInstance_gpaceventkeypress(JNIEnv * env, jobject obj, jint keycode, jint rawkeycode, jint up, jint flag, jint unicode){
-        CAST_HANDLE(wr);
-        jniLOGV("keypress::start");
-        if (wr)
-          wr->onKeyPress(keycode, rawkeycode, up, flag, unicode);
-        jniLOGV("keypress::end");
-}
-/*
-JNIEXPORT void JNICALL Java_com_gpac_Osmo4_GPACInstance_getdpi(JNIEnv * env, jobject obj, jint keycode,jfloat x, jfloat y){
-        CAST_HANDLE(wr);
-        jniLOGV("get DPI::start");
-       jclass cls = (*env)->GetObjectClass(env, obj);
-       jmethodID mid = (*env)->GetStaticMethodID(env, cls, "getdpi", "(FF)V");
-       if (mid == 0)
-         return;
-       (*env)->CallStaticIntMethod(env, cls, mid, x,y);
-        jniLOGV("get DPI::end");
-}
-*/
-
-/*
- * Class:     com_gpac_Osmo4_GPACInstance
- * Method:    setGpacPreference
- * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_gpac_Osmo4_GPACInstance_setGpacPreference
-  (JNIEnv * env, jobject obj, jstring category, jstring name, jstring value){
-        CAST_HANDLE(wr);
-        jboolean isCopy;
-        const char * scat = env->GetStringUTFChars(category, &isCopy);
-        const char * sname = env->GetStringUTFChars(name, &isCopy);
-        const char * svalue;
-        if (value)
-          svalue = env->GetStringUTFChars(value, &isCopy);
-        else
-          svalue = NULL;
-        if (wr)
-          wr->setGpacPreference(scat, sname, svalue);
-        env->ReleaseStringUTFChars(category, scat);
-        env->ReleaseStringUTFChars(name, sname);
-        if (value)
-          env->ReleaseStringUTFChars(value, svalue);
-  }
-//-----------------------------------
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/applications/osmo4_android/res/drawable-hdpi/icon.png b/applications/osmo4_android/res/drawable-hdpi/icon.png
deleted file mode 100644 (file)
index 3f988c1..0000000
Binary files a/applications/osmo4_android/res/drawable-hdpi/icon.png and /dev/null differ
diff --git a/applications/osmo4_android/res/drawable-ldpi/icon.png b/applications/osmo4_android/res/drawable-ldpi/icon.png
deleted file mode 100644 (file)
index a7bbccd..0000000
Binary files a/applications/osmo4_android/res/drawable-ldpi/icon.png and /dev/null differ
diff --git a/applications/osmo4_android/res/drawable-mdpi/icon.png b/applications/osmo4_android/res/drawable-mdpi/icon.png
deleted file mode 100644 (file)
index 883b9dc..0000000
Binary files a/applications/osmo4_android/res/drawable-mdpi/icon.png and /dev/null differ
diff --git a/applications/osmo4_android/res/layout/about_dialog.xml b/applications/osmo4_android/res/layout/about_dialog.xml
deleted file mode 100644 (file)
index ad3ff7f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"
-    android:layout_height="fill_parent" android:orientation="vertical">
-    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal"
-        android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="2dip" android:gravity="center_vertical"
-        android:layout_gravity="top|center_horizontal">
-        <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/icon"
-            android:padding="2dip" android:id="@+id/about_img1"/>
-        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"
-            android:layout_height="wrap_content" android:orientation="vertical">
-            <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/aboutCopyright1"
-                android:text="@string/aboutCopyright1" android:layout_gravity="right"/>
-            <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/aboutCopyright1"
-                android:text="@string/aboutCopyright2" android:layout_gravity="right"/>
-            <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/aboutLicence"
-                android:text="@string/aboutLicence" android:layout_gravity="right"/>
-            <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/aboutAuthors"
-                android:text="@string/aboutAuthors"/>
-        </LinearLayout>
-    </LinearLayout>
-    <ListView android:id="@+id/aboutAuthors_listView" android:layout_width="fill_parent"
-        android:isScrollContainer="true" android:entries="@array/allAuthors_array" android:layout_height="fill_parent"
-        style="@android:style/Widget.TextView"/>
-</LinearLayout>
diff --git a/applications/osmo4_android/res/layout/auth_requested.xml b/applications/osmo4_android/res/layout/auth_requested.xml
deleted file mode 100644 (file)
index 6b12f81..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"
-    android:layout_height="fill_parent">
-    <LinearLayout android:id="@+id/verticalLayout" android:layout_width="fill_parent"
-        android:layout_height="wrap_content" android:orientation="vertical">
-        <TableLayout android:layout_height="wrap_content" android:layout_width="fill_parent"
-            android:id="@+id/usernameAndPasswordLayout">
-            <TableRow android:id="@+id/tableRow1" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal"
-                android:layout_width="fill_parent" android:baselineAligned="true">
-                <TextView android:id="@+id/userNameLabel" android:layout_width="wrap_content"
-                    android:layout_gravity="right" android:text="@string/usernameLabel" android:layout_height="fill_parent"/>
-                <EditText android:inputType="textUri" android:id="@+id/userNamePrompt" android:layout_height="wrap_content"
-                    android:text="" android:hint="@string/usernameHint" android:layout_width="fill_parent"
-                    android:gravity="fill_horizontal|right" android:layout_weight="2"/>
-            </TableRow>
-            <TableRow android:id="@+id/tableRow2" android:layout_height="wrap_content" android:gravity="fill_horizontal"
-                android:layout_gravity="fill_horizontal">
-                <TextView android:id="@+id/passwordLabel" android:layout_width="fill_parent"
-                    android:baselineAligned="true" android:layout_height="wrap_content" android:layout_gravity="right"
-                    android:text="@string/passwordLabel" android:layout_weight="0"/>
-                <EditText android:inputType="textPassword" android:hint="@string/passwordHint" android:id="@+id/passwordPrompt"
-                    android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_gravity="fill_horizontal"
-                    android:text="" android:gravity="fill_horizontal|right" android:layout_weight="2"/>
-            </TableRow>
-        </TableLayout>
-        <LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent"
-            android:layout_height="wrap_content">
-            <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content"
-                android:layout_height="wrap_content"/>
-            <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content"
-                android:layout_height="wrap_content"/>
-
-
-        </LinearLayout>
-    </LinearLayout>
-
-
-</FrameLayout>
diff --git a/applications/osmo4_android/res/layout/file_view.xml b/applications/osmo4_android/res/layout/file_view.xml
deleted file mode 100644 (file)
index 0336f5a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content"
-    android:orientation="vertical" android:layout_width="fill_parent">
-    <TextView android:text="@+id/TextView01" android:id="@+id/TextView01" android:layout_width="wrap_content"
-        android:layout_height="wrap_content" android:singleLine="true" android:textStyle="bold"
-        android:layout_marginTop="5dip" android:layout_marginLeft="5dip"></TextView>
-    <TextView android:text="@+id/TextView02" android:id="@+id/TextView02" android:layout_width="wrap_content"
-        android:layout_height="wrap_content" android:layout_marginLeft="10dip"></TextView>
-</LinearLayout>
\ No newline at end of file
diff --git a/applications/osmo4_android/res/menu/main_menu.xml b/applications/osmo4_android/res/menu/main_menu.xml
deleted file mode 100644 (file)
index fffd2f8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:visible="true" android:enabled="true" android:title="@string/open_file" android:id="@+id/open_file"
-        android:checkable="false"/>
-    <item android:visible="true" android:enabled="true" android:title="@string/open_url" android:id="@+id/open_url"
-        android:checkable="false"/>
-    <item android:visible="true" android:id="@+id/quit" android:title="@string/quit" android:enabled="true"
-        android:checkable="false"/>
-    <group android:id="@+id/options" android:enabled="true" android:visible="true" android:checkableBehavior="none"
-        android:menuCategory="secondary">
-        <item android:visible="true" android:enabled="true" android:title="@string/showVirtualKeyboard" android:id="@+id/showVirtualKeyboard"
-            android:checkable="false"/>
-        <item android:checkable="false" android:visible="true" android:title="@string/about" android:id="@+id/about"
-            android:enabled="true"/>
-        <item android:id="@+id/cleanCache" android:enabled="true" android:title="@string/cleanCache"
-            android:checkable="false" android:visible="true"/>
-        <item android:enabled="true" android:checkable="false" android:id="@+id/setAsStartupFile" android:visible="true"
-            android:title="@string/setAsStartupFile"/>
-        <item android:enabled="true" android:checkable="false" android:id="@+id/resetGpacConfig" android:visible="true"
-            android:title="@string/resetGpacConfig"/>
-    </group>
-
-</menu>
diff --git a/applications/osmo4_android/res/values/strings.xml b/applications/osmo4_android/res/values/strings.xml
deleted file mode 100644 (file)
index 25db600..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="ok_button">OK</string>
-    <string name="cancel_button">Cancel</string>
-    <string name="resetGpacConfigMessage">This will remove all GPAC settings. You have to quit the applications to apply changes. Do you
-        want to continue ?</string>
-    <string name="open_file">Open file...</string>
-    <string name="open_url">Open URL...</string>
-    <string name="about">About...</string>
-    <string name="quit">Exit</string>
-    <string name="app_name">Osmo4</string>
-    <string name="titleWithURL">Osmo4 [%s]</string>
-    <string name="copying_native_libs">Copying module %1$s to %2$s...</string>
-    <string name="displayPopupFormat">%1$s\n%2$s</string>
-    <string name="gpacNotInitialized">GPAC is not initialized</string>
-    <string name="cleanCache">Clean Cache</string>
-    <string name="cleaningCache">Cleaning Cache...</string>
-    <string name="cleaningCacheDirectory">Cleaning Cache directory %s...</string>
-    <string name="showVirtualKeyboard">Keyboard</string>
-    <string name="gpacNotInitializedLongMessages">Sorry, GPAC is not initialized, operation cannot be performed</string>
-    <string name="usernameLabel">Username:</string>
-    <string name="usernameHint">Username</string>
-    <string name="passwordLabel">Password:</string>
-    <string name="passwordHint">Password</string>
-    <string name="pleaseSelectAFile">Select a file to open</string>
-    <string name="parentDirectory">Parent Directory</string>
-    <string name="directory">Directory</string>
-    <string name="fileSize">File [%d bytes]</string>
-    <string name="selectFileTitlePattern">%1$s [%2$s]</string>
-    <string name="selectFileDefaultTitle">Select a file</string>
-    <string name="options">Options</string>
-    <string name="aboutTitle">Osmo4 : GPAC for Android</string>
-    <string name="aboutCopyright1">© Jean Le Feuvre, 2000-2011</string>
-    <string name="aboutCopyright2">© Telecom-Paris-Tech</string>
-    <string name="aboutLicence">published under LGPL</string>
-    <string name="aboutAuthors">Authors:</string>
-    <string name="osmoLoading">Osmo4 is loading...</string>
-    <string name="gpacLoading">Gpac is loading...</string>
-    <string name="resetGpacConfig">Reset GPAC Config</string>
-    <string name="setAsStartupFile">Set as startup file...</string>
-    <string name="setAsStartupFileMessage">Use %s as startup file ?</string>
-    <string name="setAsStartupFileTitle">Startup file</string>
-    <string name="setAsStartupFileYes">Use current</string>
-    <string name="setAsStartupFileNo">Cancel</string>
-    <string name="setAsStartupFileNull">No startup file</string>
-    <string name="setAsStartupFileMessageNoURL">You are not connected to any URL. You may use this entry to set an URL as a startup file when
-        connected to a given URL or file.
-    </string>
-    <!--  All authors in alphabetical order -->
-    <string-array name="allAuthors_array">
-        <item>Romain Bouqueau</item>
-        <item>Cyril Concolato</item>
-        <item>Jean Lefeuvre</item>
-        <item>Jonathan Sillan</item>
-        <item>Pierre Souchay (VizionR)</item>
-        <item>NGO Van Luyen</item>
-    </string-array>
-</resources>
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/BitmapView.java b/applications/osmo4_android/src/com/gpac/Osmo4/BitmapView.java
deleted file mode 100644 (file)
index d851a82..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-///**
-// *  Osmo on Android
-// *  Aug/2010
-// *  NGO Van Luyen
-// *
-// *
-// */
-//package com.gpac.Osmo4;
-//
-//import android.content.Context;
-//import android.graphics.Bitmap;
-//import android.graphics.Canvas;
-//import android.util.Log;
-//import android.view.View;
-//
-///**
-// * 
-// * @version $Revision: 3371 $
-// * 
-// */
-//@Deprecated
-//public class BitmapView extends View {
-//
-//    private Bitmap m_Bitmap = null;
-//
-//    private int m_width = 100, m_height = 100;
-//
-//    private final static String LOG_BITMAP = BitmapView.class.getSimpleName();
-//
-//    /**
-//     * Constructor
-//     * 
-//     * @param context The current view's context
-//     */
-//    public BitmapView(Context context) {
-//        super(context);
-//    }
-//
-//    @Override
-//    protected void onDraw(Canvas canvas) {
-//        // canvas.drawColor(0xFFCCCCCC);
-//        m_width = canvas.getWidth();
-//        m_height = canvas.getHeight();
-//        if (m_Bitmap == null) {
-//            if (m_width < 1)
-//                m_width = 100;
-//            if (m_height < 1)
-//                m_height = 100;
-//            m_Bitmap = Bitmap.createBitmap(m_width, m_height, Bitmap.Config.ARGB_8888);
-//            gpacinit();
-//        }
-//
-//        GpacObject.gpacrender(m_Bitmap);
-//        canvas.drawBitmap(m_Bitmap, 0, 0, null);
-//        // force a redraw, with a different time-based pattern.
-//        invalidate();
-//
-//    }
-//
-//    /**
-//     * Called to init all GPAC resources
-//     */
-//    private void gpacinit() {
-//        Log.i(LOG_BITMAP, "Going to gpacinit"); //$NON-NLS-1$
-//        if (m_Bitmap != null) {
-//            Log.e(LOG_BITMAP, "m_Bitmap != null"); //$NON-NLS-1$
-//            if (m_width < 1)
-//                m_width = 100;
-//            if (m_height < 1)
-//                m_height = 100;
-//            GpacObject.gpacinit(m_Bitmap,
-//                                null,
-//                                m_width,
-//                                m_height,
-//                                Osmo4Renderer.GPAC_CFG_DIR,
-//                                Osmo4Renderer.GPAC_MODULES_DIR,
-//                                Osmo4Renderer.GPAC_CACHE_DIR,
-//                                Osmo4Renderer.GPAC_FONT_DIR,
-//                                null);
-//            // GpacObject.gpacconnect("/data/osmo/bifs-2D-interactivity-stringsensor.mp4");
-//            GpacObject.gpacresize(m_width, m_height);
-//        }
-//    }
-//
-//    /**
-//     * Called to free all GPAC resources
-//     */
-//    public void gpacfree() {
-//        Log.e(LOG_BITMAP, "gpacfree()"); //$NON-NLS-1$
-//        GpacObject.gpacdisconnect();
-//        GpacObject.gpacfree();
-//    }
-// }
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/GPACInstance.java b/applications/osmo4_android/src/com/gpac/Osmo4/GPACInstance.java
deleted file mode 100644 (file)
index 6e2c06f..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-/**
- * $URL: http://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac/applications/osmo4_android/src/com/gpac/Osmo4/GPACInstance.java $
- *
- * $LastChangedBy: enst_devs $ - $LastChangedDate: 2011-07-05 18:35:26 +0200(mar, 05 lug 2011) $
- */
-package com.gpac.Osmo4;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-
-/**
- * @version $Revision: 3371 $
- * 
- */
-public class GPACInstance implements GPACInstanceInterface {
-
-    private final static String LOG_LIB = "LibrariesLoader"; //$NON-NLS-1$
-
-    private final Thread uniqueThread;
-
-    private static void listing(StringBuilder sb, File root, int inc) {
-        StringBuilder increment = new StringBuilder();
-        for (int i = 0; i < inc; i++)
-            increment.append(' ');
-        String incr = increment.toString();
-        for (File f : root.listFiles()) {
-            sb.append(incr).append(f.getName());
-            if (f.isDirectory()) {
-                sb.append(" [Directory]\n"); //$NON-NLS-1$
-                listing(sb, f, inc + 2);
-            } else {
-                sb.append(" [").append(f.length() + " bytes]\n"); //$NON-NLS-1$//$NON-NLS-2$
-            }
-        }
-    }
-
-    /**
-     * Loads all libraries
-     * 
-     * @param config
-     * 
-     * @return a map of exceptions containing the library as key and the exception as value. If map is empty, no error
-     * 
-     */
-    synchronized static Map<String, Throwable> loadAllLibraries(GpacConfig config) {
-        if (errors != null)
-            return errors;
-        StringBuilder sb = new StringBuilder();
-        final String[] toLoad = { "GLESv1_CM", "dl", "log",//$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
-                                 "jpeg", "javaenv", //$NON-NLS-1$ //$NON-NLS-2$ 
-                                 "mad", "editline", "ft2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                                 "js_osmo", "openjpeg", "png", "z", //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$
-                                 "ffmpeg", "faad", "gpac", //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
-                                 "stdc++", "gpacWrapper" }; // //$NON-NLS-1$ //$NON-NLS-2$
-        HashMap<String, Throwable> exceptions = new HashMap<String, Throwable>();
-        for (String s : toLoad) {
-            try {
-                String msg = "Loading library " + s + "...";//$NON-NLS-1$//$NON-NLS-2$
-                sb.append(msg);
-                Log.i(LOG_LIB, msg);
-                System.loadLibrary(s);
-            } catch (UnsatisfiedLinkError e) {
-                sb.append("Failed to load " + s + ", error=" + e.getLocalizedMessage() + " :: " //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
-                          + e.getClass().getSimpleName() + "\n"); //$NON-NLS-1$
-                exceptions.put(s, e);
-                Log.e(LOG_LIB, "Failed to load library : " + s + " due to link error " + e.getLocalizedMessage(), e); //$NON-NLS-1$ //$NON-NLS-2$
-            } catch (SecurityException e) {
-                exceptions.put(s, e);
-                Log.e(LOG_LIB, "Failed to load library : " + s + " due to security error " + e.getLocalizedMessage(), e); //$NON-NLS-1$ //$NON-NLS-2$
-            } catch (Throwable e) {
-                exceptions.put(s, e);
-                Log.e(LOG_LIB, "Failed to load library : " + s + " due to Runtime error " + e.getLocalizedMessage(), e); //$NON-NLS-1$ //$NON-NLS-2$
-            }
-        }
-
-        if (!exceptions.isEmpty()) {
-            try {
-                PrintStream out = new PrintStream(config.getGpacConfigDirectory() + "debug_libs.txt", "UTF-8"); //$NON-NLS-1$//$NON-NLS-2$
-                out.println("$Revision: 3371 $"); //$NON-NLS-1$
-                out.println(new Date());
-                out.println("\n*** Configuration\n"); //$NON-NLS-1$
-                out.println(config.getConfigAsText());
-                sb.append("*** Libs listing: "); //$NON-NLS-1$
-                sb.append(config.getGpacLibsDirectory());
-                sb.append('\n');
-                listing(sb, new File(config.getGpacLibsDirectory()), 2);
-                sb.append("*** Modules listing: "); //$NON-NLS-1$
-                sb.append(config.getGpacModulesDirectory());
-                sb.append('\n');
-                listing(sb, new File(config.getGpacModulesDirectory()), 2);
-                sb.append("*** Fonts listing: \n"); //$NON-NLS-1$
-                sb.append(config.getGpacFontDirectory());
-                sb.append('\n');
-                listing(sb, new File(config.getGpacFontDirectory()), 2);
-                sb.append("*** Exceptions:\n"); //$NON-NLS-1$
-                for (Map.Entry<String, Throwable> ex : exceptions.entrySet()) {
-                    sb.append(ex.getKey()).append(": ") //$NON-NLS-1$
-                      .append(ex.getValue().getLocalizedMessage())
-                      .append('(')
-                      .append(ex.getValue().getClass())
-                      .append(")\n"); //$NON-NLS-1$
-                }
-                out.println(sb.toString());
-                out.flush();
-                out.close();
-            } catch (Exception e) {
-                Log.e(LOG_LIB, "Failed to output debug info to debug file", e); //$NON-NLS-1$
-            }
-        }
-        errors = Collections.unmodifiableMap(exceptions);
-        return errors;
-    }
-
-    private static Map<String, Throwable> errors = null;
-
-    private boolean hasToBeFreed = true;
-
-    /**
-     * Constructor
-     * 
-     * @param callback
-     * @param width
-     * @param height
-     * @param config The configuration to use for GPAC
-     * @param urlToOpen
-     * @throws GpacInstanceException
-     */
-    public GPACInstance(GpacCallback callback, int width, int height, GpacConfig config, String urlToOpen)
-            throws GpacInstanceException {
-        StringBuilder sb = new StringBuilder();
-        Map<String, Throwable> errors = loadAllLibraries(config);
-        if (!errors.isEmpty()) {
-            sb.append("Exceptions while loading libraries:"); //$NON-NLS-1$
-            for (Map.Entry<String, Throwable> x : errors.entrySet()) {
-                sb.append('\n')
-                  .append(x.getKey())
-                  .append('[')
-                  .append(x.getValue().getClass().getSimpleName())
-                  .append("]: ") //$NON-NLS-1$
-                  .append(x.getValue().getLocalizedMessage());
-            }
-            Log.e(LOG_LIB, sb.toString());
-        }
-        try {
-            handle = createInstance(callback,
-                                    width,
-                                    height,
-                                    config.getGpacConfigDirectory(),
-                                    config.getGpacModulesDirectory(),
-                                    config.getGpacCacheDirectory(),
-                                    config.getGpacFontDirectory(),
-                                    urlToOpen);
-        } catch (Throwable e) {
-            throw new GpacInstanceException("Error while creating instance\n" + sb.toString()); //$NON-NLS-1$
-        }
-        if (handle == 0) {
-            throw new GpacInstanceException("Error while creating instance, no handle created!\n" + sb.toString()); //$NON-NLS-1$
-        }
-        synchronized (this) {
-            hasToBeFreed = true;
-        }
-        uniqueThread = Thread.currentThread();
-    }
-
-    /**
-     * This one handles the pointer to the real C object
-     */
-    private final long handle;
-
-    /**
-     * @return the handle
-     */
-    public synchronized long getHandle() {
-        return handle;
-    }
-
-    private void checkCurrentThread() throws RuntimeException {
-        if (Thread.currentThread() != uniqueThread)
-            throw new RuntimeException("Method called outside allowed Thread scope !"); //$NON-NLS-1$
-    }
-
-    @Override
-    public void disconnect() {
-        checkCurrentThread();
-        gpacdisconnect();
-    }
-
-    @Override
-    public void connect(String url) {
-        Log.i(LOG_LIB, "connect(" + url + ")"); //$NON-NLS-1$ //$NON-NLS-2$
-        checkCurrentThread();
-        gpacconnect(url);
-    }
-
-    /**
-     * Call this method when a key has been pressed
-     * 
-     * @param keyCode
-     * @param event
-     * @param pressed true if key is pressed, false if key is released
-     * @param unicode
-     */
-    public void eventKey(int keyCode, KeyEvent event, boolean pressed, int unicode) {
-        checkCurrentThread();
-        gpaceventkeypress(keyCode, event.getScanCode(), pressed ? 1 : 0, event.getFlags(), unicode);
-    }
-
-    /**
-     * Renders the current frame
-     */
-    public void render() {
-        checkCurrentThread();
-        gpacrender();
-    }
-
-    /**
-     * Resizes the object to new dimensions
-     * 
-     * @param width
-     * @param height
-     */
-    public void resize(int width, int height) {
-        Log.i(LOG_LIB, "Resizing to " + width + "x" + height); //$NON-NLS-1$ //$NON-NLS-2$
-        gpacresize(width, height);
-    }
-
-    /**
-     * Call this when a motion event occurs
-     * 
-     * @param event
-     */
-    public void motionEvent(MotionEvent event) {
-        checkCurrentThread();
-        final float x = event.getX();
-        final float y = event.getY();
-        switch (event.getAction()) {
-            // not in 1.6 case MotionEvent.ACTION_POINTER_1_DOWN:
-            case MotionEvent.ACTION_DOWN:
-                gpaceventmousemove(x, y);
-                gpaceventmousedown(x, y);
-                break;
-            // not in 1.6 case MotionEvent.ACTION_POINTER_1_UP:
-            case MotionEvent.ACTION_UP:
-                gpaceventmouseup(x, y);
-                break;
-            case MotionEvent.ACTION_MOVE:
-                gpaceventmousemove(x, y);
-        }
-    }
-
-    @Override
-    public void finalize() throws Throwable {
-        // Not sure how to do this..., destroy is supposed to be called already
-        // destroy();
-        super.finalize();
-    }
-
-    /**
-     * All Native functions, those functions are binded using the handle
-     */
-
-    /**
-     * Opens an URL
-     * 
-     * @param url The URL to open
-     */
-    private native void gpacconnect(String url);
-
-    /**
-     * Used to create the GPAC instance
-     * 
-     * @param callback
-     * @param width
-     * @param height
-     * @param cfg_dir
-     * @param modules_dir
-     * @param cache_dir
-     * @param font_dir
-     * @return
-     */
-    private native long createInstance(GpacCallback callback, int width, int height, String cfg_dir,
-            String modules_dir, String cache_dir, String font_dir, String url_to_open);
-
-    /**
-     * Disconnects the currently loaded URL
-     */
-    private native void gpacdisconnect();
-
-    /**
-     * Renders
-     * 
-     * @param handle
-     */
-    private native void gpacrender();
-
-    /**
-     * Resizes the current view
-     * 
-     * @param width The new width to set
-     * @param height The new height to set
-     */
-    private native void gpacresize(int width, int height);
-
-    /**
-     * Free all GPAC resources
-     */
-    private native void gpacfree();
-
-    /**
-     * To call when a key has been pressed
-     * 
-     * @param keycode
-     * @param rawkeycode
-     * @param up
-     * @param flag
-     */
-    private native void gpaceventkeypress(int keycode, int rawkeycode, int up, int flag, int unicode);
-
-    /**
-     * To call when a mouse is down
-     * 
-     * @param x Position in pixels
-     * @param y Position in pixels
-     */
-    private native void gpaceventmousedown(float x, float y);
-
-    /**
-     * To call when a mouse is up (released)
-     * 
-     * @param x Position in pixels
-     * @param y Position in pixels
-     */
-    private native void gpaceventmouseup(float x, float y);
-
-    /**
-     * To call when a mouse is moving
-     * 
-     * @param x Position in pixels
-     * @param y Position in pixels
-     */
-    private native void gpaceventmousemove(float x, float y);
-
-    @Override
-    public void destroy() {
-        boolean freeIt;
-        synchronized (this) {
-            freeIt = hasToBeFreed;
-            hasToBeFreed = false;
-        }
-        if (freeIt) {
-            disconnect();
-            gpacfree();
-        }
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GPACInstanceInterface#setGpacPreference(String, String, String)
-     */
-    @Override
-    public native void setGpacPreference(String category, String name, String value);
-}
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/GPACInstanceInterface.java b/applications/osmo4_android/src/com/gpac/Osmo4/GPACInstanceInterface.java
deleted file mode 100644 (file)
index 7d3244e..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * $URL: http://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac/applications/osmo4_android/src/com/gpac/Osmo4/GPACInstanceInterface.java $
- *
- * $LastChangedBy: enst_devs $ - $LastChangedDate: 2011-07-05 18:35:26 +0200(mar, 05 lug 2011) $
- */
-package com.gpac.Osmo4;
-
-/**
- * @copyright RTL Group 2008
- * @author RTL Group DTIT software development team (last changed by $LastChangedBy: enst_devs $)
- * @version $Revision: 3371 $
- * 
- */
-public interface GPACInstanceInterface {
-
-    /**
-     * @version $Revision: 3371 $
-     * 
-     */
-    public static class GpacInstanceException extends Exception {
-
-        /**
-         * 
-         */
-        private static final long serialVersionUID = 3207851655866335152L;
-
-        /**
-         * Constructor
-         * 
-         * @param msg
-         */
-        public GpacInstanceException(String msg) {
-            super(msg);
-        }
-
-    };
-
-    /**
-     * Call this method to disconnect
-     */
-    public void disconnect();
-
-    /**
-     * Call this method to connect to a given URL
-     * 
-     * @param url The URL to connect to
-     */
-    public void connect(String url);
-
-    /**
-     * Destroys the current instance, you won't be able to use it anymore...
-     */
-    public void destroy();
-
-    /**
-     * Set a GPAC preference to given value
-     * 
-     * @param category
-     * @param name The name of preference as defined in GPAC.cfg
-     * @param value The value to set, if null, value will be deleted
-     */
-    public void setGpacPreference(String category, String name, String value);
-
-}
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/GpacCallback.java b/applications/osmo4_android/src/com/gpac/Osmo4/GpacCallback.java
deleted file mode 100644 (file)
index f45e5cd..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-/**
- * $URL: http://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac/applications/osmo4_android/src/com/gpac/Osmo4/GpacCallback.java $
- *
- * $LastChangedBy: enst_devs $ - $LastChangedDate: 2011-07-05 18:35:26 +0200(mar, 05 lug 2011) $
- */
-package com.gpac.Osmo4;
-
-/**
- * Interface to implement by Java Objects to listen for callbacks from GPAC native code
- * 
- * @version $Revision: 3371 $
- * 
- */
-public interface GpacCallback {
-
-    /**
-     * GPAC Error codes
-     * 
-     * @version $Revision: 3371 $
-     * 
-     */
-    public enum GF_Err {
-
-        /** Message from any scripting engine used in the presentation (ECMAScript, MPEG-J, ...) (Info). */
-        GF_SCRIPT_INFO(3),
-        /**
-         * Indicates an data frame has several AU packed (not MPEG-4 compliant). This is used by decoders to force
-         * multiple decoding of the same data frame (Info).
-         */
-        GF_PACKED_FRAMES(2),
-        /** Indicates the end of a stream or of a file (Info). */
-        GF_EOS(1),
-        /*
-         * ! \n\n
-         */
-        /** Operation success (no error). */
-        GF_OK(0),
-        /** \n */
-        /** One of the input parameter is not correct or cannot be used in the current operating mode of the framework. */
-        GF_BAD_PARAM(-1),
-        /** Memory allocation failure. */
-        GF_OUT_OF_MEM(-2),
-        /** Input/Output failure (disk access, system call failures) */
-        GF_IO_ERR(-3),
-        /** The desired feature or operation is not supported by the framework */
-        GF_NOT_SUPPORTED(-4),
-        /** Input data has been corrupted */
-        GF_CORRUPTED_DATA(-5),
-        /** A modification was attempted on a scene node which could not be found */
-        GF_SG_UNKNOWN_NODE(-6),
-        /** The PROTO node interface does not match the nodes using it */
-        GF_SG_INVALID_PROTO(-7),
-        /** An error occured in the scripting engine */
-        GF_SCRIPT_ERROR(-8),
-        /**
-         * Buffer is too small to contain decoded data. Decoders shall use this error whenever they need to resize their
-         * output memory buffers
-         */
-        GF_BUFFER_TOO_SMALL(-9),
-        /** Bitstream is not compliant to the specfication it refers to */
-        GF_NON_COMPLIANT_BITSTREAM(-10),
-        /** No decoders could be found to handle the desired media type */
-        GF_CODEC_NOT_FOUND(-11),
-        /** The URL is not properly formatted or cannot be found */
-        GF_URL_ERROR(-12),
-        /** An service error has occured at the local side */
-        GF_SERVICE_ERROR(-13),
-        /** A service error has occured at the remote (server) side */
-        GF_REMOTE_SERVICE_ERROR(-14),
-        /** The desired stream could not be found in the service */
-        GF_STREAM_NOT_FOUND(-15),
-        /** The IsoMedia file is not a valid one */
-        GF_ISOM_INVALID_FILE(-20),
-        /** The IsoMedia file is not complete. Either the file is being downloaded, or it has been truncated */
-        GF_ISOM_INCOMPLETE_FILE(-21),
-        /** The media in this IsoMedia track is not valid (usually due to a broken stream description) */
-        GF_ISOM_INVALID_MEDIA(-22),
-        /** The requested operation cannot happen in the current opening mode of the IsoMedia file */
-        GF_ISOM_INVALID_MODE(-23),
-        /** This IsoMedia track refers to media outside the file in an unknown way */
-        GF_ISOM_UNKNOWN_DATA_REF(-24),
-
-        /** An invalid MPEG-4 Object Descriptor was found */
-        GF_ODF_INVALID_DESCRIPTOR(-30),
-        /** An MPEG-4 Object Descriptor was found or added to a forbidden descriptor */
-        GF_ODF_FORBIDDEN_DESCRIPTOR(-31),
-        /** An invalid MPEG-4 BIFS command was detected */
-        GF_ODF_INVALID_COMMAND(-32),
-        /** The scene has been encoded using an unknown BIFS version */
-        GF_BIFS_UNKNOWN_VERSION(-33),
-
-        /** The remote IP address could not be solved */
-        GF_IP_ADDRESS_NOT_FOUND(-40),
-        /** The connection to the remote peer has failed */
-        GF_IP_CONNECTION_FAILURE(-41),
-        /** The network operation has failed */
-        GF_IP_NETWORK_FAILURE(-42),
-        /** The network connection has been closed */
-        GF_IP_CONNECTION_CLOSED(-43),
-        /** The network operation has failed because no data is available */
-        GF_IP_NETWORK_EMPTY(-44),
-        /** The network operation has been discarded because it would be a blocking one */
-        GF_IP_SOCK_WOULD_BLOCK(-45),
-        /**
-         * UDP connection did not receive any data at all. Signaled by client services to reconfigure network if
-         * possible
-         */
-        GF_IP_UDP_TIMEOUT(-46),
-
-        /** Authentication with the remote host has failed */
-        GF_AUTHENTICATION_FAILURE(-50),
-        /** Script not ready for playback */
-        GF_SCRIPT_NOT_READY(-51),
-
-        /**
-         * Unknown GPAC Error code
-         */
-        JAVA_UNKNOWN_ERROR(-100);
-
-        int value;
-
-        GF_Err(int x) {
-            this.value = x;
-        };
-
-        /**
-         * Get a GPAC Error code from its value
-         * 
-         * @param status The int status corresponding to the error
-         * @return A {@link GF_Err} object
-         */
-        public static GF_Err getError(int status) {
-            for (GF_Err x : values()) {
-                if (x.value == status)
-                    return x;
-            }
-            return JAVA_UNKNOWN_ERROR;
-        }
-    }
-
-    /**
-     * Mapping between GPAC Log Modules and Java symbols
-     * 
-     * @version $Revision: 3371 $
-     * 
-     */
-    public enum GF_Log_Module implements Comparable<GF_Log_Module> {
-        /** Log message from the core library (init, threads, network calls, etc) */
-        GF_LOG_CORE(1),
-        /** Log message from a raw media parser (BIFS, LASeR, A/V formats) */
-        GF_LOG_CODING(1 << 1),
-        /** Log message from a bitstream parser (IsoMedia, MPEG-2 TS, OGG, ...) */
-        GF_LOG_CONTAINER(1 << 2),
-        /** Log message from the network/service stack (messages & co) */
-        GF_LOG_NETWORK(1 << 3),
-        /** Log message from the RTP/RTCP stack (TS info) and packet structure & hinting (debug) */
-        GF_LOG_RTP(1 << 4),
-        /** Log message from authoring subsystem (file manip, import/export) */
-        GF_LOG_AUTHOR(1 << 5),
-        /** Log message from the sync layer of the terminal */
-        GF_LOG_SYNC(1 << 6),
-        /** Log message from a codec */
-        GF_LOG_CODEC(1 << 7),
-        /** Log message from any XML parser (context loading, etc) */
-        GF_LOG_PARSER(1 << 8),
-        /** Log message from the terminal/compositor, indicating media object state */
-        GF_LOG_MEDIA(1 << 9),
-        /** Log message from the scene graph/scene manager (handling of nodes and attribute modif, DOM core) */
-        GF_LOG_SCENE(1 << 10),
-        /** Log message from the scripting engine */
-        GF_LOG_SCRIPT(1 << 11),
-        /** Log message from event handling */
-        GF_LOG_INTERACT(1 << 12),
-        /** Log message from compositor */
-        GF_LOG_COMPOSE(1 << 13),
-        /** Log for video object cache */
-        GF_LOG_CACHE(1 << 14),
-        /** Log message from multimedia I/O devices (audio/video input/output, ...) */
-        GF_LOG_MMIO(1 << 15),
-        /** Log for runtime info (times, memory, CPU usage) */
-        GF_LOG_RTI(1 << 16),
-        /** Log for SMIL timing and animation */
-        GF_LOG_SMIL(1 << 17),
-        /** Log for memory tracker */
-        GF_LOG_MEMORY(1 << 18),
-        /** Log for audio compositor */
-        GF_LOG_AUDIO(1 << 19),
-        /** generic Log for modules */
-        GF_LOG_MODULE(1 << 20),
-        /**
-         * Log for GPAC mutexes and threads (Very verbose at DEBUG)
-         * 
-         */
-        GF_LOG_MUTEX(1 << 21),
-        /**
-         * Unknown Log subsystem
-         */
-        GF_LOG_UNKNOWN(1 << 30);
-
-        int value;
-
-        /**
-         * Private Constructor
-         */
-        private GF_Log_Module(int x) {
-            this.value = x;
-        };
-
-        /**
-         * Finds a module from its module_code
-         * 
-         * @param module_code
-         * @return The Module found (never null)
-         */
-        public static GF_Log_Module getModule(int module_code) {
-            for (GF_Log_Module x : values()) {
-                if (x.value == module_code)
-                    return x;
-            }
-            return GF_LOG_UNKNOWN;
-        }
-    }
-
-    /**
-     * Display a message
-     * 
-     * @param message
-     * @param title
-     * @param errorCode
-     */
-    public void displayMessage(String message, String title, int errorCode);
-
-    /**
-     * Called when logging
-     * 
-     * @param level
-     * @param module
-     * @param message
-     */
-    public void onLog(int level, int module, String message);
-
-    /**
-     * Called when progress is set
-     * 
-     * @param msg
-     * @param done
-     * @param total
-     */
-    public void onProgress(String msg, int done, int total);
-
-    /**
-     * Called when GPAC is ready
-     */
-    public void onGPACReady();
-
-    /**
-     * Called when GPAC initialization fails
-     * 
-     * @param e
-     */
-    public void onGPACError(Throwable e);
-
-    // /**
-    // * Returns UserName:Password for given site
-    // *
-    // * @param siteURL The URL of site requiring authorization
-    // * @param userName The User Name (may be null if never set)
-    // * @param password The password (may be null if never set)
-    // * @return A String formated as username:password
-    // */
-    // public String onGPACAuthorization(String siteURL, String userName, String password);
-
-    /**
-     * Set the new caption for the application
-     * 
-     * @param newCaption The new caption to set for application
-     */
-    public void setCaption(String newCaption);
-
-    /**
-     * Show the virtual keyboard
-     * 
-     * @param showKeyboard
-     */
-    public void showKeyboard(boolean showKeyboard);
-}
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/GpacConfig.java b/applications/osmo4_android/src/com/gpac/Osmo4/GpacConfig.java
deleted file mode 100644 (file)
index 35bf440..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/**
- * $URL: http://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac/applications/osmo4_android/src/com/gpac/Osmo4/GpacConfig.java $
- *
- * $LastChangedBy: enst_devs $ - $LastChangedDate: 2011-07-05 18:35:26 +0200(mar, 05 lug 2011) $
- */
-package com.gpac.Osmo4;
-
-import java.io.File;
-import android.content.Context;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.os.Environment;
-import android.util.Log;
-
-/**
- * This class handles all GPAC configuration directories
- * 
- * @author Pierre Souchay (VizionR SAS) (last changed by $LastChangedBy: enst_devs $)
- * @version $Revision: 3371 $
- * 
- */
-public class GpacConfig {
-
-    private final static String LOG_GPAC_CONFIG = GpacConfig.class.getSimpleName();
-
-    /**
-     * Default Constructor
-     * 
-     * @param context
-     */
-    public GpacConfig(Context context) {
-        File rootCfg = Environment.getExternalStorageDirectory();
-        File osmo = new File(rootCfg, "osmo"); //$NON-NLS-1$
-        gpacConfigDirectory = osmo.getAbsolutePath() + '/';
-        Log.v(LOG_GPAC_CONFIG, "Using directory " + gpacConfigDirectory + " for osmo"); //$NON-NLS-1$ //$NON-NLS-2$
-        gpacCacheDirectory = new File(osmo, "cache").getAbsolutePath() + '/'; //$NON-NLS-1$
-        Log.v(LOG_GPAC_CONFIG, "Using directory " + gpacCacheDirectory + " for cache"); //$NON-NLS-1$ //$NON-NLS-2$
-        //gpacModulesDirectory = (new File(Environment.getDataDirectory() + "/data", "com.gpac.Osmo4")).getAbsolutePath() + '/'; //$NON-NLS-1$ //$NON-NLS-2$
-        //Log.v(LOG_GPAC_CONFIG, "Using directory " + gpacModulesDirectory + " for modules"); //$NON-NLS-1$ //$NON-NLS-2$
-        String dataDir;
-        try {
-            if (context == null || context.getPackageManager() == null) {
-                dataDir = Environment.getDataDirectory() + "/data/com.gpac.Osmo4/"; //$NON-NLS-1$
-                Log.e(LOG_GPAC_CONFIG, "Cannot get context or PackageManager, using default directory=" + dataDir); //$NON-NLS-1$
-            } else
-                dataDir = context.getPackageManager().getApplicationInfo(context.getPackageName(), 0).dataDir;
-        } catch (NameNotFoundException e) {
-            Log.e(LOG_GPAC_CONFIG, "This is bad, we cannot find ourself : " + context.getPackageName(), e); //$NON-NLS-1$
-            throw new RuntimeException("Cannot find package " + context.getPackageName(), e); //$NON-NLS-1$
-        }
-        gpacLibsDirectory = dataDir + "/lib/"; //$NON-NLS-1$
-        Log.v(LOG_GPAC_CONFIG, "Using directory " + gpacLibsDirectory + " for libraries"); //$NON-NLS-1$ //$NON-NLS-2$
-
-    }
-
-    /**
-     * Ensures all directories are created
-     * 
-     * @return The {@link GpacConfig} instance itself
-     */
-    public GpacConfig ensureAllDirectoriesExist() {
-        for (String s : new String[] { gpacConfigDirectory, gpacCacheDirectory }) {
-            createDirIfNotExist(s);
-        }
-        return this;
-    }
-
-    private final String gpacConfigDirectory;
-
-    /**
-     * Default directory for GPAC configuration directory, ends with /
-     * 
-     * @return the gpacConfigDirectory
-     */
-    public String getGpacConfigDirectory() {
-        return gpacConfigDirectory;
-    }
-
-    /**
-     * Directory of Android containing all fonts
-     * 
-     * @return the gpacFontDirectory
-     */
-    public String getGpacFontDirectory() {
-        return gpacFontDirectory;
-    }
-
-    /**
-     * Default directory for GPAC modules directory, ends with /
-     * 
-     * @return the gpacModulesDirectory
-     */
-    public String getGpacModulesDirectory() {
-        // return gpacModulesDirectory;
-        return gpacLibsDirectory;
-    }
-
-    /**
-     * @return the gpacLibsDirectory
-     */
-    public String getGpacLibsDirectory() {
-        return gpacLibsDirectory;
-    }
-
-    /**
-     * Default directory for cached files
-     * 
-     * @return the gpacCacheDirectory
-     */
-    public String getGpacCacheDirectory() {
-        return gpacCacheDirectory;
-    }
-
-    private final String gpacFontDirectory = "/system/fonts/"; //$NON-NLS-1$
-
-    // private final String gpacModulesDirectory;
-
-    private final String gpacLibsDirectory;
-
-    private final String gpacCacheDirectory;
-
-    /**
-     * Creates a given directory if it does not exist
-     * 
-     * @param path
-     */
-    private static boolean createDirIfNotExist(String path) {
-        File f = new File(path);
-        if (!f.exists()) {
-            if (!f.mkdirs()) {
-                Log.e(LOG_GPAC_CONFIG, "Failed to create directory " + path); //$NON-NLS-1$
-                return false;
-            } else {
-                Log.i(LOG_GPAC_CONFIG, "Created directory " + path); //$NON-NLS-1$
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Get the GPAC.cfg file
-     * 
-     * @return the file
-     */
-    public File getGpacConfigFile() {
-        return new File(getGpacConfigDirectory(), "GPAC.cfg"); //$NON-NLS-1$
-    }
-
-    /**
-     * Get the GPAC.cfg file
-     * 
-     * @return the file
-     */
-    public File getGpacLastRevFile() {
-        return new File(getGpacCacheDirectory(), "lastRev.txt"); //$NON-NLS-1$
-    }
-
-    /**
-     * Get the configuration as text
-     * 
-     * @return a String with newlines representing all the configuration
-     */
-    public String getConfigAsText() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("GpacConfigDirectory=").append(getGpacConfigDirectory()).append('\n'); //$NON-NLS-1$
-        sb.append("GpacModulesDirectory=").append(getGpacModulesDirectory()).append('\n'); //$NON-NLS-1$
-        sb.append("GpacFontDirectory=").append(getGpacFontDirectory()).append('\n'); //$NON-NLS-1$
-        sb.append("GpacCacheDirectory=").append(getGpacCacheDirectory()).append('\n'); //$NON-NLS-1$
-        return sb.toString();
-    }
-}
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/Osmo4.java b/applications/osmo4_android/src/com/gpac/Osmo4/Osmo4.java
deleted file mode 100644 (file)
index 94ba4e3..0000000
+++ /dev/null
@@ -1,943 +0,0 @@
-/**
- *  Osmo on Android
- *  Aug/2010
- *  NGO Van Luyen
- * $Id: Osmo4.java 3371 2011-07-05 16:35:26Z enst_devs $
- *
- */
-package com.gpac.Osmo4;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.ProgressDialog;
-import android.content.ActivityNotFoundException;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.DialogInterface.OnClickListener;
-import android.content.res.Configuration;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.PowerManager;
-import android.os.PowerManager.WakeLock;
-import android.text.InputType;
-import android.util.Log;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.Window;
-import android.view.WindowManager;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.ArrayAdapter;
-import android.widget.AutoCompleteTextView;
-import android.widget.Toast;
-import com.gpac.Osmo4.extra.FileChooserActivity;
-import com.gpac.Osmo4.logs.GpacLogger;
-
-/**
- * The main Osmo4 activity, used to launch everything
- * 
- * @version $Revision: 3371 $
- * 
- */
-public class Osmo4 extends Activity implements GpacCallback {
-
-    // private String[] m_modules_list;
-
-    private boolean shouldDeleteGpacConfig = false;
-
-    /**
-     * @return the shouldDeleteGpacConfig
-     */
-    public synchronized boolean isShouldDeleteGpacConfig() {
-        return shouldDeleteGpacConfig;
-    }
-
-    /**
-     * @param shouldDeleteGpacConfig the shouldDeleteGpacConfig to set
-     */
-    public synchronized void setShouldDeleteGpacConfig(boolean shouldDeleteGpacConfig) {
-        this.shouldDeleteGpacConfig = shouldDeleteGpacConfig;
-    }
-
-    private final static String CFG_STARTUP_CATEGORY = "General"; //$NON-NLS-1$
-
-    private final static String CFG_STARTUP_NAME = "StartupFile"; //$NON-NLS-1$
-
-    private boolean keyboardIsVisible = false;
-
-    private final static int DEFAULT_BUFFER_SIZE = 8192;
-
-    private GpacConfig gpacConfig;
-
-    /**
-     * Activity request ID for picking a file from local file system
-     */
-    public final static int PICK_FILE_REQUEST = 1;
-
-    private final static String LOG_OSMO_TAG = "Osmo4"; //$NON-NLS-1$
-
-    /**
-     * List of all extensions recognized by Osmo
-     */
-    public final static String OSMO_REGISTERED_FILE_EXTENSIONS = "*.mp4,*.bt,*.xmt,*.xml,*.ts,*.svg,*.mp3,*.m3u8,*.mpg,*.aac,*.m4a,*.jpg,*.png"; //$NON-NLS-1$
-
-    private PowerManager.WakeLock wl = null;
-
-    private Osmo4GLSurfaceView mGLView;
-
-    private GpacLogger logger;
-
-    private ProgressDialog startupProgress;
-
-    // ---------------------------------------
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        requestWindowFeature(Window.FEATURE_PROGRESS);
-        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
-
-        final String toOpen;
-        if (Intent.ACTION_VIEW.equals(getIntent().getAction())) {
-            Uri uri = getIntent().getData();
-            if (uri != null) {
-                synchronized (this) {
-                    toOpen = uri.toString();
-                }
-            } else
-                toOpen = null;
-        } else
-            toOpen = null;
-        if (gpacConfig == null) {
-            gpacConfig = new GpacConfig(this);
-            if (gpacConfig == null)
-                Log.e(LOG_OSMO_TAG, "Failed to load GPAC config"); //$NON-NLS-1$
-            else
-                gpacConfig.ensureAllDirectoriesExist();
-        }
-        if (logger == null)
-            logger = new GpacLogger(gpacConfig);
-        logger.onCreate();
-        if (startupProgress == null) {
-            startupProgress = new ProgressDialog(this);
-            startupProgress.setCancelable(false);
-        }
-        startupProgress.setMessage(getResources().getText(R.string.osmoLoading));
-        startupProgress.setTitle(R.string.osmoLoading);
-        startupProgress.show();
-        if (mGLView != null) {
-            setContentView(mGLView);
-            if (toOpen != null)
-                openURLasync(toOpen);
-            // OK, it means activity has already been started
-            return;
-        }
-        mGLView = new Osmo4GLSurfaceView(Osmo4.this);
-        service.submit(new Runnable() {
-
-            @Override
-            public void run() {
-                // loadAllModules();
-                runOnUiThread(new Runnable() {
-
-                    @Override
-                    public void run() {
-                        startupProgress.setIndeterminate(true);
-                        startupProgress.setMessage(getResources().getText(R.string.gpacLoading));
-                        PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
-                        WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, LOG_OSMO_TAG);
-                        if (wl != null)
-                            wl.acquire();
-                        synchronized (Osmo4.this) {
-                            Osmo4.this.wl = wl;
-                        }
-
-                        Osmo4Renderer renderer = new Osmo4Renderer(Osmo4.this, gpacConfig, toOpen);
-                        mGLView.setRenderer(renderer);
-                        setContentView(mGLView);
-                    }
-                });
-
-            }
-        });
-
-    }
-
-    // ---------------------------------------
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        MenuInflater inflater = getMenuInflater();
-        inflater.inflate(R.menu.main_menu, menu);
-        return true;
-    }
-
-    private String getRecentURLsFile() {
-        return gpacConfig.getGpacConfigDirectory() + "recentURLs.txt"; //$NON-NLS-1$
-    }
-
-    private boolean openURL() {
-        Future<String[]> res = service.submit(new Callable<String[]>() {
-
-            @Override
-            public String[] call() throws Exception {
-                BufferedReader reader = null;
-                try {
-                    reader = new BufferedReader(new InputStreamReader(new FileInputStream(getRecentURLsFile()),
-                                                                      DEFAULT_ENCODING), DEFAULT_BUFFER_SIZE);
-
-                    String s = null;
-                    Set<String> results = new HashSet<String>();
-                    while (null != (s = reader.readLine())) {
-                        results.add(s);
-                    }
-                    addAllRecentURLs(results);
-                    return results.toArray(new String[0]);
-                } finally {
-                    if (reader != null)
-                        reader.close();
-                }
-            }
-        });
-        AlertDialog.Builder builder = new AlertDialog.Builder(this);
-        final AutoCompleteTextView textView = new AutoCompleteTextView(this);
-        textView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
-
-        builder.setMessage("Please enter an URL to connect to...") //$NON-NLS-1$
-               .setCancelable(true)
-               .setPositiveButton("Open URL", new DialogInterface.OnClickListener() { //$NON-NLS-1$
-
-                                      public void onClick(DialogInterface dialog, int id) {
-                                          dialog.cancel();
-                                          final String newURL = textView.getText().toString();
-                                          openURLasync(newURL);
-                                          service.execute(new Runnable() {
-
-                                              @Override
-                                              public void run() {
-                                                  addAllRecentURLs(Collections.singleton(newURL));
-                                                  File tmp = new File(getRecentURLsFile() + ".tmp"); //$NON-NLS-1$
-                                                  BufferedWriter w = null;
-                                                  try {
-                                                      w = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tmp),
-                                                                                                    DEFAULT_ENCODING),
-                                                                             DEFAULT_BUFFER_SIZE);
-                                                      Collection<String> toWrite = getAllRecentURLs();
-                                                      for (String s : toWrite) {
-                                                          w.write(s);
-                                                          w.write("\n"); //$NON-NLS-1$
-                                                      }
-                                                      w.close();
-                                                      w = null;
-                                                      if (tmp.renameTo(new File(getRecentURLsFile())))
-                                                          Log.e(LOG_OSMO_TAG,
-                                                                "Failed to rename " + tmp + " to " + getRecentURLsFile()); //$NON-NLS-1$//$NON-NLS-2$
-
-                                                  } catch (IOException e) {
-                                                      Log.e(LOG_OSMO_TAG, "Failed to write recent URLs to " + tmp, e); //$NON-NLS-1$
-                                                      try {
-                                                          if (w != null)
-                                                              w.close();
-                                                      } catch (IOException ex) {
-                                                          Log.e(LOG_OSMO_TAG, "Failed to close stream " + tmp, ex); //$NON-NLS-1$
-                                                      }
-                                                  }
-
-                                              }
-                                          });
-                                      }
-                                  })
-               .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { //$NON-NLS-1$
-
-                                      public void onClick(DialogInterface dialog, int id) {
-                                          dialog.cancel();
-                                      }
-                                  });
-
-        textView.setText("http://"); //$NON-NLS-1$
-        builder.setView(textView);
-
-        builder.show();
-        ArrayAdapter<String> adapter;
-        try {
-            adapter = new ArrayAdapter<String>(this,
-                                               android.R.layout.simple_dropdown_item_1line,
-                                               res.get(1, TimeUnit.SECONDS));
-            textView.setAdapter(adapter);
-        } catch (ExecutionException e) {
-            // Ignored
-            Log.e(LOG_OSMO_TAG, "Error while parsing recent URLs", e); //$NON-NLS-1$
-        } catch (TimeoutException e) {
-            Log.e(LOG_OSMO_TAG, "It took too long to parse recent URLs", e); //$NON-NLS-1$
-        } catch (InterruptedException e) {
-            Log.e(LOG_OSMO_TAG, "Interrupted while parsing recent URLs", e); //$NON-NLS-1$
-        }
-
-        return true;
-    }
-
-    private final ExecutorService service = Executors.newSingleThreadExecutor();
-
-    private final Set<String> allRecentURLs = new HashSet<String>();
-
-    private synchronized void addAllRecentURLs(Collection<String> urlsToAdd) {
-        allRecentURLs.addAll(urlsToAdd);
-    }
-
-    private synchronized Collection<String> getAllRecentURLs() {
-        return new ArrayList<String>(allRecentURLs);
-    }
-
-    private final static Charset DEFAULT_ENCODING = Charset.forName("UTF-8"); //$NON-NLS-1$
-
-    /**
-     * Opens a new activity to select a file
-     * 
-     * @return true if activity has been selected
-     */
-    private boolean openFileDialog() {
-        String title = getResources().getString(R.string.pleaseSelectAFile);
-        Uri uriDefaultDir = Uri.fromFile(new File(gpacConfig.getGpacConfigDirectory()));
-        Intent intent = new Intent();
-        intent.setAction(Intent.ACTION_PICK);
-        // Files and directories
-        intent.setDataAndType(uriDefaultDir, "vnd.android.cursor.dir/lysesoft.andexplorer.file"); //$NON-NLS-1$
-        // Optional filtering on file extension.
-        intent.putExtra("browser_filter_extension_whitelist", OSMO_REGISTERED_FILE_EXTENSIONS); //$NON-NLS-1$
-        // Title
-        intent.putExtra("explorer_title", title); //$NON-NLS-1$
-
-        try {
-            startActivityForResult(intent, PICK_FILE_REQUEST);
-            return true;
-        } catch (ActivityNotFoundException e) {
-            // OK, lets try with another one... (it includes out bundled one)
-            intent = new Intent("org.openintents.action.PICK_FILE"); //$NON-NLS-1$
-            intent.setData(uriDefaultDir);
-            intent.putExtra(FileChooserActivity.TITLE_PARAMETER, title);
-            intent.putExtra("browser_filter_extension_whitelist", OSMO_REGISTERED_FILE_EXTENSIONS); //$NON-NLS-1$
-            try {
-                startActivityForResult(intent, PICK_FILE_REQUEST);
-                return true;
-            } catch (ActivityNotFoundException ex) {
-                // Not found neither... We build our own dialog to display error
-                // Note that this should happen only if we did not embed out own intent
-                AlertDialog.Builder builder = new AlertDialog.Builder(this);
-                builder.setMessage("Impossible to find an Intent to choose a file... Cannot open file !") //$NON-NLS-1$
-                       .setCancelable(true)
-                       .setPositiveButton("Close", new DialogInterface.OnClickListener() { //$NON-NLS-1$
-
-                                              public void onClick(DialogInterface dialog, int id) {
-                                                  dialog.cancel();
-                                              }
-                                          });
-                AlertDialog alert = builder.create();
-                alert.show();
-                return false;
-            }
-        }
-    }
-
-    // ---------------------------------------
-    @Override
-    protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
-        if (requestCode == PICK_FILE_REQUEST) {
-            if (resultCode == RESULT_OK) {
-                Uri uri = intent.getData();
-                if (uri != null) {
-                    String url = uri.toString();
-                    String file = "file://"; //$NON-NLS-1$
-                    if (url.startsWith(file)) {
-                        url = uri.getPath();
-                    }
-                    Log.i(LOG_OSMO_TAG, "Requesting opening local file " + url); //$NON-NLS-1$
-                    openURLasync(url);
-                }
-            }
-        }
-    }
-
-    private String currentURL;
-
-    private void openURLasync(final String url) {
-        service.execute(new Runnable() {
-
-            @Override
-            public void run() {
-                mGLView.connect(url);
-                currentURL = url;
-                runOnUiThread(new Runnable() {
-
-                    @Override
-                    public void run() {
-                        setTitle(getResources().getString(R.string.titleWithURL, url));
-                    }
-                });
-            }
-        });
-    }
-
-    // ---------------------------------------
-
-    @Override
-    public void onConfigurationChanged(Configuration newConfig) {
-        super.onConfigurationChanged(newConfig);
-    }
-
-    // ---------------------------------------
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        // Handle item selection
-        switch (item.getItemId()) {
-            case R.id.open_url:
-                return openURL();
-            case R.id.open_file:
-                // newGame();
-                return openFileDialog();
-            case R.id.cleanCache:
-                return cleanCache();
-            case R.id.showVirtualKeyboard:
-                showKeyboard(true);
-                return true;
-            case R.id.setAsStartupFile: {
-                AlertDialog.Builder b = new AlertDialog.Builder(this);
-                b.setTitle(R.string.setAsStartupFileTitle);
-                if (currentURL != null) {
-                    b.setMessage(getResources().getString(R.string.setAsStartupFileMessage, currentURL));
-                    b.setPositiveButton(R.string.setAsStartupFileYes, new OnClickListener() {
-
-                        @Override
-                        public void onClick(DialogInterface dialog, int which) {
-                            dialog.dismiss();
-                            mGLView.setGpacPreference(CFG_STARTUP_CATEGORY, CFG_STARTUP_NAME, currentURL);
-                        }
-                    });
-                } else {
-                    b.setMessage(getResources().getString(R.string.setAsStartupFileMessageNoURL));
-                }
-                b.setNegativeButton(R.string.setAsStartupFileNo, new OnClickListener() {
-
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-                        dialog.dismiss();
-                    }
-                });
-                b.setNeutralButton(R.string.setAsStartupFileNull, new OnClickListener() {
-
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-                        dialog.dismiss();
-                        mGLView.setGpacPreference(CFG_STARTUP_CATEGORY, CFG_STARTUP_NAME, null);
-                    }
-                });
-                b.show();
-                return true;
-            }
-            case R.id.resetGpacConfig: {
-                AlertDialog.Builder b = new AlertDialog.Builder(this);
-                b.setCancelable(true);
-                b.setTitle(R.string.resetGpacConfig);
-                b.setMessage(R.string.resetGpacConfigMessage);
-                b.setNegativeButton(R.string.cancel_button, new OnClickListener() {
-
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-                        dialog.dismiss();
-                    }
-                });
-                b.setPositiveButton(R.string.ok_button, new OnClickListener() {
-
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-                        dialog.dismiss();
-                        setShouldDeleteGpacConfig(true);
-                        deleteConfigIfNeeded();
-                    }
-                });
-                b.show();
-                return true;
-            }
-            case R.id.about: {
-                Dialog d = new Dialog(this);
-                d.setTitle(R.string.aboutTitle);
-                d.setCancelable(true);
-                d.setContentView(R.layout.about_dialog);
-                d.show();
-            }
-                return true;
-            case R.id.quit:
-                this.finish();
-                mGLView.destroy();
-                return true;
-            default:
-                return super.onOptionsItemSelected(item);
-        }
-    }
-
-    protected boolean cleanCache() {
-        final CharSequence oldTitle = getTitle();
-        runOnUiThread(new Runnable() {
-
-            @Override
-            public void run() {
-                startupProgress.setTitle(R.string.cleaningCache);
-                startupProgress.setMessage(getResources().getString(R.string.cleaningCache,
-                                                                    gpacConfig.getGpacCacheDirectory()));
-                startupProgress.setProgress(0);
-                startupProgress.setIndeterminate(false);
-                startupProgress.show();
-            }
-        });
-        service.submit(new Runnable() {
-
-            @Override
-            public void run() {
-                File dir = new File(gpacConfig.getGpacCacheDirectory());
-                if (!dir.exists() || !dir.canRead() || !dir.canWrite() || !dir.isDirectory()) {
-                    return;
-                }
-                File files[] = dir.listFiles();
-                int i = 0;
-                for (File f : files) {
-                    if (f.isFile())
-                        if (!f.delete()) {
-                            Log.w(LOG_OSMO_TAG, "Failed to delete file " + f); //$NON-NLS-1$
-                        } else {
-                            Log.v(LOG_OSMO_TAG, f + " has been deleted"); //$NON-NLS-1$
-                        }
-                    final int percent = (++i) * 100 / files.length;
-                    runOnUiThread(new Runnable() {
-
-                        @Override
-                        public void run() {
-                            startupProgress.setProgress(percent);
-                        }
-                    });
-                }
-                runOnUiThread(new Runnable() {
-
-                    @Override
-                    public void run() {
-                        startupProgress.setProgress(100);
-                        startupProgress.setTitle(oldTitle);
-                        startupProgress.dismiss();
-                    }
-                });
-            }
-        });
-        return true;
-    }
-
-    private void deleteConfigIfNeeded() {
-        if (isShouldDeleteGpacConfig()) {
-            Log.i(LOG_OSMO_TAG, "Deleting GPAC config file..."); //$NON-NLS-1$
-            File f = gpacConfig.getGpacConfigFile();
-            if (f.exists() && !f.delete()) {
-                Log.e(LOG_OSMO_TAG, "Failed to delete " + f.getAbsolutePath()); //$NON-NLS-1$
-            }
-            f = gpacConfig.getGpacLastRevFile();
-            if (f.exists() && !f.delete()) {
-                Log.e(LOG_OSMO_TAG, "Failed to delete " + f.getAbsolutePath()); //$NON-NLS-1$
-            }
-        }
-    }
-
-    // ---------------------------------------
-    @Override
-    protected void onDestroy() {
-        deleteConfigIfNeeded();
-        service.shutdown();
-        logger.onDestroy();
-        synchronized (this) {
-            if (wl != null)
-                wl.release();
-        }
-        Log.d(LOG_OSMO_TAG, "Disconnecting instance..."); //$NON-NLS-1$
-        mGLView.disconnect();
-        Log.d(LOG_OSMO_TAG, "Destroying GPAC instance..."); //$NON-NLS-1$
-        mGLView.destroy();
-        // Deleteing is done two times if GPAC fails to shutdown by crashing...
-        deleteConfigIfNeeded();
-        super.onDestroy();
-    }
-
-    // ---------------------------------------
-    // private void loadAllModules() {
-    //        Log.i(LOG_OSMO_TAG, "Start loading all modules..."); //$NON-NLS-1$
-    // long start = System.currentTimeMillis();
-    // byte buffer[] = new byte[1024];
-    // int[] ids = getAllRawResources();
-    //        String currentRevision = "$Revision: 3371 $"; //$NON-NLS-1$
-    // File revisionFile = gpacConfig.getGpacLastRevFile();
-    // boolean fastStartup = false;
-    // // We check if we already copied all the modules once without error...
-    // if (revisionFile.exists() && revisionFile.canRead()) {
-    // BufferedReader r = null;
-    // try {
-    // r = new BufferedReader(new InputStreamReader(new FileInputStream(revisionFile), DEFAULT_ENCODING),
-    // DEFAULT_BUFFER_SIZE);
-    // String rev = r.readLine();
-    // if (currentRevision.equals(rev)) {
-    // fastStartup = true;
-    // }
-    // } catch (IOException ignored) {
-    // } finally {
-    // // Exception or not, always close the stream...
-    // if (r != null)
-    // try {
-    // r.close();
-    // } catch (IOException ignored) {
-    // }
-    // }
-    // }
-    // boolean noErrors = true;
-    // final StringBuilder errorsMsg = new StringBuilder();
-    // for (int i = 0; i < ids.length; i++) {
-    // OutputStream fos = null;
-    // InputStream ins = null;
-    //            String fn = gpacConfig.getGpacModulesDirectory() + m_modules_list[i] + ".so"; //$NON-NLS-1$
-    // File finalFile = new File(fn);
-    // // If file has already been copied, not need to do it again
-    // if (fastStartup && finalFile.exists() && finalFile.canRead()) {
-    //                Log.i(LOG_OSMO_TAG, "Skipping " + finalFile); //$NON-NLS-1$
-    // continue;
-    // }
-    // try {
-    // final String msg = getResources().getString(R.string.copying_native_libs,
-    // finalFile.getName(),
-    // finalFile.getParent());
-    // runOnUiThread(new Runnable() {
-    //
-    // @Override
-    // public void run() {
-    // startupProgress.setIndeterminate(false);
-    // startupProgress.setMessage(msg);
-    // }
-    // });
-    //                Log.i(LOG_OSMO_TAG, "Copying resource " + ids[i] + " to " //$NON-NLS-1$//$NON-NLS-2$
-    // + finalFile.getAbsolutePath());
-    //                File tmpFile = new File(fn + ".tmp"); //$NON-NLS-1$
-    // int read;
-    // ins = new BufferedInputStream(getResources().openRawResource(ids[i]), DEFAULT_BUFFER_SIZE);
-    // fos = new BufferedOutputStream(new FileOutputStream(tmpFile), DEFAULT_BUFFER_SIZE);
-    // while (0 < (read = ins.read(buffer))) {
-    // fos.write(buffer, 0, read);
-    // }
-    // ins.close();
-    // ins = null;
-    // fos.close();
-    // fos = null;
-    // if (!tmpFile.renameTo(finalFile)) {
-    // if (finalFile.exists() && finalFile.delete() && !tmpFile.renameTo(finalFile))
-    //                        Log.e(LOG_OSMO_TAG, "Failed to rename " + tmpFile.getAbsolutePath() + " to " //$NON-NLS-1$//$NON-NLS-2$
-    // + finalFile.getAbsolutePath());
-    // }
-    // final int percent = i * 10000 / ids.length;
-    // runOnUiThread(new Runnable() {
-    //
-    // @Override
-    // public void run() {
-    // startupProgress.setProgress(percent);
-    // }
-    // });
-    // } catch (IOException e) {
-    // noErrors = false;
-    //                String msg = "IOException for resource : " + ids[i]; //$NON-NLS-1$
-    // errorsMsg.append(msg).append('\n').append(finalFile.getAbsolutePath()).append('\n');
-    // errorsMsg.append(e.getLocalizedMessage());
-    // Log.e(LOG_OSMO_TAG, msg, e);
-    // } finally {
-    // if (ins != null) {
-    // try {
-    // ins.close();
-    // } catch (IOException e) {
-    //                        Log.e(LOG_OSMO_TAG, "Error while closing read stream", e); //$NON-NLS-1$
-    // }
-    // }
-    // if (fos != null) {
-    // try {
-    // fos.close();
-    // } catch (IOException e) {
-    //                        Log.e(LOG_OSMO_TAG, "Error while closing write stream", e); //$NON-NLS-1$
-    // }
-    // }
-    // }
-    // }
-    // // If no error during copy, fast startup will be enabled for next time
-    // if (noErrors && !fastStartup) {
-    // BufferedWriter w = null;
-    // try {
-    // w = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(revisionFile), DEFAULT_ENCODING),
-    // DEFAULT_BUFFER_SIZE);
-    // w.write(currentRevision);
-    // w.write('\n');
-    // // We add the date as second line to ease debug in case of problem
-    // w.write(String.valueOf(new Date()));
-    // } catch (IOException ignored) {
-    // } finally {
-    // if (w != null)
-    // try {
-    // w.close();
-    // } catch (IOException ignored) {
-    // }
-    // }
-    // } else {
-    // if (!noErrors) {
-    // setShouldDeleteGpacConfig(true);
-    //                displayMessage(errorsMsg.toString(), "Errors while copying modules !", GF_Err.GF_IO_ERR.value); //$NON-NLS-1$
-    // }
-    // }
-    //        Log.i(LOG_OSMO_TAG, "Done loading all modules, took " + (System.currentTimeMillis() - start) + "ms."); //$NON-NLS-1$ //$NON-NLS-2$
-    // startupProgress.setProgress(100);
-    // startupProgress.setIndeterminate(true);
-    // runOnUiThread(new Runnable() {
-    //
-    // @Override
-    // public void run() {
-    // setTitle(LOG_OSMO_TAG);
-    // }
-    // });
-    // }
-
-    // private int[] getAllRawResources() throws RuntimeException {
-    // R.raw r = new R.raw();
-    //
-    // java.lang.reflect.Field fields[] = R.raw.class.getDeclaredFields();
-    // final int ids[] = new int[fields.length];
-    // m_modules_list = new String[fields.length];
-    //
-    // try {
-    // for (int i = 0; i < fields.length; i++) {
-    // java.lang.reflect.Field f = fields[i];
-    // ids[i] = f.getInt(r);
-    // m_modules_list[i] = f.getName();
-    //                Log.i(LOG_OSMO_TAG, "R.raw." + f.getName() + " = 0x" + Integer.toHexString(ids[i])); //$NON-NLS-1$ //$NON-NLS-2$
-    // }
-    // } catch (IllegalArgumentException e) {
-    // throw new RuntimeException(e);
-    // } catch (IllegalAccessException e) {
-    // throw new RuntimeException(e);
-    // }
-    //
-    // return ids;
-    // }
-
-    // ---------------------------------------
-
-    private String lastDisplayedMessage;
-
-    private void displayPopup(CharSequence message, CharSequence title) {
-        final String fullMsg = getResources().getString(R.string.displayPopupFormat, title, message);
-        synchronized (this) {
-            if (fullMsg.equals(lastDisplayedMessage))
-                return;
-            lastDisplayedMessage = fullMsg;
-        }
-        runOnUiThread(new Runnable() {
-
-            @Override
-            public void run() {
-                Toast toast = Toast.makeText(Osmo4.this, fullMsg, Toast.LENGTH_SHORT);
-                toast.show();
-            }
-        });
-
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GpacCallback#displayMessage(String, String, int)
-     */
-    @Override
-    public void displayMessage(final String message, final String title, final int status) {
-        if (status == GF_Err.GF_OK.value)
-            displayPopup(message, title);
-        else {
-            runOnUiThread(new Runnable() {
-
-                @Override
-                public void run() {
-                    StringBuilder sb = new StringBuilder();
-                    sb.append(GF_Err.getError(status));
-                    sb.append(' ');
-                    sb.append(title);
-                    AlertDialog.Builder builder = new AlertDialog.Builder(Osmo4.this);
-                    builder.setTitle(sb.toString());
-                    sb.append('\n');
-                    sb.append(message);
-                    builder.setMessage(sb.toString());
-                    builder.setCancelable(true);
-                    builder.setPositiveButton(R.string.ok_button, new OnClickListener() {
-
-                        @Override
-                        public void onClick(DialogInterface dialog, int which) {
-                            dialog.cancel();
-                        }
-                    });
-                    try {
-                        builder.create().show();
-                    } catch (WindowManager.BadTokenException e) {
-                        // May happen when we close the window and there are still somes messages
-                        Log.e(LOG_OSMO_TAG, "Failed to display Message " + sb.toString(), e); //$NON-NLS-1$
-                    }
-                }
-            });
-        }
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GpacCallback#onLog(int, int, String)
-     */
-    @Override
-    public void onLog(int level, int module, String message) {
-        logger.onLog(level, module, message);
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GpacCallback#onProgress(java.lang.String, int, int)
-     */
-    @Override
-    public void onProgress(final String msg, final int done, final int total) {
-        if (Log.isLoggable(LOG_OSMO_TAG, Log.DEBUG))
-            Log.d(LOG_OSMO_TAG, "Setting progress to " + done + "/" + total + ", message=" + msg); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        runOnUiThread(new Runnable() {
-
-            @Override
-            public void run() {
-                // GPAC sometimes return total = 0
-                if (total < 1) {
-                    setProgressBarIndeterminate(true);
-                } else {
-                    int progress = done * 10000 / (total < 1 ? 1 : total);
-                    if (progress > 9900)
-                        progress = 10000;
-                    setProgressBarIndeterminate(false);
-                    setProgress(progress);
-                }
-            }
-        });
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GpacCallback#onGPACReady()
-     */
-    @Override
-    public void onGPACReady() {
-        startupProgress.dismiss();
-        Log.i(LOG_OSMO_TAG, "GPAC is ready"); //$NON-NLS-1$
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GpacCallback#onGPACError(java.lang.Throwable)
-     */
-    @Override
-    public void onGPACError(final Throwable e) {
-        startupProgress.dismiss();
-        Log.e(LOG_OSMO_TAG, "GPAC Error", e); //$NON-NLS-1$
-        runOnUiThread(new Runnable() {
-
-            @Override
-            public void run() {
-                // In such case, we force GPAC Configuration file deletion
-                setShouldDeleteGpacConfig(true);
-                StringBuilder sb = new StringBuilder();
-                sb.append("Failed to init GPAC due to "); //$NON-NLS-1$
-                sb.append(e.getClass().getSimpleName());
-                AlertDialog.Builder builder = new AlertDialog.Builder(Osmo4.this);
-                builder.setTitle(sb.toString());
-                sb.append('\n');
-                sb.append("Description: "); //$NON-NLS-1$
-                sb.append(e.getLocalizedMessage());
-                sb.append('\n');
-                sb.append("Revision: $Revision: 3371 $"); //$NON-NLS-1$
-                sb.append("\nConfiguration information :\n") //$NON-NLS-1$
-                  .append(gpacConfig.getConfigAsText());
-                builder.setMessage(sb.toString());
-                builder.setCancelable(true);
-                builder.setPositiveButton(R.string.ok_button, new OnClickListener() {
-
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-                        dialog.cancel();
-                    }
-                });
-                builder.create().show();
-            }
-        });
-    }
-
-    @Override
-    protected void onPause() {
-        super.onPause();
-        if (mGLView != null)
-            mGLView.onPause();
-    }
-
-    @Override
-    protected void onResume() {
-        super.onResume();
-        if (mGLView != null)
-            mGLView.onResume();
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GpacCallback#setCaption(java.lang.String)
-     */
-    @Override
-    public void setCaption(final String newCaption) {
-        runOnUiThread(new Runnable() {
-
-            @Override
-            public void run() {
-                setTitle(newCaption);
-            }
-        });
-    }
-
-    /**
-     * @see android.app.Activity#onStop()
-     */
-    @Override
-    protected void onStop() {
-        Log.i(LOG_OSMO_TAG, "onStop called on activity"); //$NON-NLS-1$
-        super.onStop();
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GpacCallback#showKeyboard(boolean)
-     */
-    @Override
-    public void showKeyboard(boolean showKeyboard) {
-        if (keyboardIsVisible == showKeyboard == true)
-            return;
-        InputMethodManager mgr = ((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE));
-        this.keyboardIsVisible = showKeyboard;
-        if (showKeyboard)
-            mgr.showSoftInput(mGLView, 0);
-        else
-            mgr.hideSoftInputFromInputMethod(mGLView.getWindowToken(), 0);
-
-    }
-}
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/Osmo4GLSurfaceView.java b/applications/osmo4_android/src/com/gpac/Osmo4/Osmo4GLSurfaceView.java
deleted file mode 100644 (file)
index 005d83b..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-package com.gpac.Osmo4;
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-
-/**
- * The view represented the blitted contents by libgpac
- * 
- * @version $Revision: 3371 $
- * 
- */
-public class Osmo4GLSurfaceView extends GLSurfaceView implements GPACInstanceInterface {
-
-    private final static String LOG_GL_SURFACE = Osmo4GLSurfaceView.class.getSimpleName();
-
-    /**
-     * Constructor
-     * 
-     * @param context
-     */
-    public Osmo4GLSurfaceView(Context context) {
-        super(context);
-        setDebugFlags(DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS);
-        setFocusable(true);
-        setFocusableInTouchMode(true);
-    }
-
-    private Osmo4Renderer gpacRenderer;
-
-    /**
-     * Set the renderer
-     * 
-     * @param renderer
-     */
-    public void setRenderer(Osmo4Renderer renderer) {
-        synchronized (this) {
-            this.gpacRenderer = renderer;
-        }
-        super.setRenderer(renderer);
-        setRenderMode(RENDERMODE_CONTINUOUSLY);
-    }
-
-    private synchronized Osmo4Renderer getGpacRenderer() {
-        return gpacRenderer;
-    }
-
-    private GPACInstance getInstance() {
-        Osmo4Renderer r = getGpacRenderer();
-        if (r == null)
-            return null;
-        return r.getInstance();
-    }
-
-    // ------------------------------------
-    @Override
-    public boolean onTouchEvent(final MotionEvent event) {
-        queueEvent(new Runnable() {
-
-            @Override
-            public void run() {
-                GPACInstance instance = getInstance();
-                if (instance != null)
-                    instance.motionEvent(event);
-            }
-        });
-        return true;
-    }
-
-    /**
-     * Should we handle this key in GPAC ?
-     * 
-     * @param keyCode
-     * @param event
-     * @return
-     */
-    private static boolean handleInGPAC(int keyCode, KeyEvent event) {
-        if (event.isSystem())
-            return false;
-        switch (keyCode) {
-            case KeyEvent.KEYCODE_MEDIA_STOP:
-            case KeyEvent.KEYCODE_MENU:
-            case KeyEvent.KEYCODE_BACK:
-                return false;
-            default:
-                return true;
-        }
-    }
-
-    @Override
-    public boolean onKeyDown(final int keyCode, final KeyEvent event) {
-        if (handleInGPAC(keyCode, event)) {
-            Log.d(LOG_GL_SURFACE, "onKeyDown = " + keyCode); //$NON-NLS-1$
-            queueEvent(new Runnable() {
-
-                @Override
-                public void run() {
-                    GPACInstance instance = getInstance();
-                    if (instance != null)
-                        instance.eventKey(keyCode, event, true, event.getUnicodeChar());
-                }
-            });
-            return true;
-        }
-        return false;
-    }
-
-    // ------------------------------------
-    @Override
-    public boolean onKeyUp(final int keyCode, final KeyEvent event) {
-        if (handleInGPAC(keyCode, event)) {
-            Log.d(LOG_GL_SURFACE, "onKeyUp =" + keyCode); //$NON-NLS-1$
-            queueEvent(new Runnable() {
-
-                @Override
-                public void run() {
-                    GPACInstance instance = getInstance();
-                    if (instance != null)
-                        instance.eventKey(keyCode, event, false, event.getUnicodeChar());
-                }
-            });
-            return true;
-        }
-        return false;
-    }
-
-    @Override
-    public void onResume() {
-        if (getInstance() != null)
-            super.onResume();
-    }
-
-    @Override
-    public void onPause() {
-        if (getInstance() != null)
-            super.onPause();
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GPACInstanceInterface#connect(java.lang.String)
-     */
-    @Override
-    public void connect(final String url) {
-        queueEvent(new Runnable() {
-
-            @Override
-            public void run() {
-                GPACInstance instance = getInstance();
-                if (instance != null)
-                    instance.connect(url);
-            }
-        });
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GPACInstanceInterface#disconnect()
-     */
-    @Override
-    public void disconnect() {
-        queueEvent(new Runnable() {
-
-            @Override
-            public void run() {
-                GPACInstance instance = getInstance();
-                if (instance != null)
-                    instance.disconnect();
-            }
-        });
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GPACInstanceInterface#destroy()
-     */
-    @Override
-    public void destroy() {
-        queueEvent(new Runnable() {
-
-            @Override
-            public void run() {
-                GPACInstance instance = getInstance();
-                if (instance != null)
-                    instance.destroy();
-            }
-        });
-    }
-
-    /**
-     * @see com.gpac.Osmo4.GPACInstanceInterface#setGpacPreference(String, String, String)
-     */
-    @Override
-    public void setGpacPreference(final String category, final String name, final String value) {
-        queueEvent(new Runnable() {
-
-            @Override
-            public void run() {
-                GPACInstance instance = getInstance();
-                if (instance != null)
-                    instance.setGpacPreference(category, name, value);
-            }
-        });
-    }
-}
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/Osmo4Renderer.java b/applications/osmo4_android/src/com/gpac/Osmo4/Osmo4Renderer.java
deleted file mode 100644 (file)
index 9938457..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.gpac.Osmo4;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-import android.opengl.GLSurfaceView;
-import android.util.Log;
-
-/**
- * The renderer
- * 
- * @version $Revision: 3371 $
- * 
- */
-public class Osmo4Renderer implements GLSurfaceView.Renderer {
-
-    private final GpacConfig gpacConfig;
-
-    private final static String LOG_RENDERER = Osmo4Renderer.class.getSimpleName();
-
-    @Override
-    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
-        if (instance == null) {
-            try {
-                Log.i(LOG_RENDERER, "Creating instance from thread " + Thread.currentThread()); //$NON-NLS-1$
-                instance = new GPACInstance(callback, 320, 430, gpacConfig, urlToLoad);
-            } catch (com.gpac.Osmo4.GPACInstanceInterface.GpacInstanceException e) {
-                Log.e(LOG_RENDERER, "Failed to create new GPAC instance !"); //$NON-NLS-1$
-                instance = null;
-                callback.onGPACError(e);
-                return;
-            }
-            if (callback != null)
-                callback.onGPACReady();
-        }
-    }
-
-    private GPACInstance instance = null;
-
-    private final String urlToLoad;
-
-    /**
-     * @return the urlToLoad
-     */
-    public synchronized String getUrlToLoad() {
-        return urlToLoad;
-    }
-
-    /**
-     * Constructor
-     * 
-     * @param callback
-     * @param gpacConfig
-     * @param urlToLoad The URL to load at startup, can be null
-     */
-    public Osmo4Renderer(GpacCallback callback, GpacConfig gpacConfig, String urlToLoad) {
-        this.callback = callback;
-        this.urlToLoad = urlToLoad;
-        this.gpacConfig = gpacConfig;
-    }
-
-    private final GpacCallback callback;
-
-    @Override
-    public void onSurfaceChanged(GL10 gl, int w, int h) {
-        // gl.glViewport(0, 0, w, h);
-        if (instance != null) {
-            Log.i(LOG_RENDERER, "Surface changed from thread " + Thread.currentThread()); //$NON-NLS-1$
-            instance.resize(w, h);
-        }
-    }
-
-    private int frames;
-
-    private long startFrame = System.currentTimeMillis();
-
-    @Override
-    public void onDrawFrame(GL10 gl) {
-        if (instance != null) {
-            frames++;
-            if (frames % 1000 == 0) {
-                long now = System.currentTimeMillis();
-                Log.i(LOG_RENDERER, "Frames Per Second = " + ((now - startFrame) / 1000) + " fps"); //$NON-NLS-1$//$NON-NLS-2$
-                this.startFrame = now;
-            }
-            instance.render();
-        }
-    }
-
-    /**
-     * Get the current GPAC Instance
-     * 
-     * @return the instance
-     */
-    synchronized GPACInstance getInstance() {
-        return instance;
-    }
-}
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/extra/FileArrayAdapter.java b/applications/osmo4_android/src/com/gpac/Osmo4/extra/FileArrayAdapter.java
deleted file mode 100644 (file)
index 9e1ae1e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * $URL: http://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac/applications/osmo4_android/src/com/gpac/Osmo4/extra/FileArrayAdapter.java $
- *
- * $LastChangedBy: enst_devs $ - $LastChangedDate: 2011-07-05 18:35:26 +0200(mar, 05 lug 2011) $
- */
-package com.gpac.Osmo4.extra;
-
-import java.io.File;
-import java.util.List;
-import android.content.Context;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.TextView;
-import com.gpac.Osmo4.R;
-
-/**
- * Class that contains the list of file for given directory
- * 
- * @version $Revision: 3371 $
- * 
- */
-public class FileArrayAdapter extends ArrayAdapter<FileEntry> {
-
-    private final Context context;
-
-    private final int id;
-
-    private final List<FileEntry> items;
-
-    /**
-     * Constructor
-     * 
-     * @param context
-     * @param textViewResourceId
-     * @param objects
-     */
-    public FileArrayAdapter(Context context, int textViewResourceId, List<FileEntry> objects) {
-        super(context, textViewResourceId, objects);
-        this.context = context;
-        id = textViewResourceId;
-        items = objects;
-    }
-
-    @Override
-    public FileEntry getItem(int i) {
-        return items.get(i);
-    }
-
-    @Override
-    public View getView(int position, View convertView, ViewGroup parent) {
-        View v = convertView;
-        if (v == null) {
-            LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-            v = vi.inflate(id, null);
-        }
-        final FileEntry o = items.get(position);
-        if (o != null) {
-            TextView t1 = (TextView) v.findViewById(R.id.TextView01);
-            TextView t2 = (TextView) v.findViewById(R.id.TextView02);
-
-            if (t1 != null)
-                t1.setText(o.getName());
-            if (t2 != null) {
-                File f = o.getFile();
-                if (f.isDirectory())
-                    t2.setText(context.getString(R.string.directory));
-                else
-                    t2.setText(context.getString(R.string.fileSize, f.length()));
-            }
-        }
-        return v;
-    }
-
-}
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/extra/FileChooserActivity.java b/applications/osmo4_android/src/com/gpac/Osmo4/extra/FileChooserActivity.java
deleted file mode 100644 (file)
index 034b46a..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * $URL: http://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac/applications/osmo4_android/src/com/gpac/Osmo4/extra/FileChooserActivity.java $
- *
- * $LastChangedBy: enst_devs $ - $LastChangedDate: 2011-07-05 18:35:26 +0200(mar, 05 lug 2011) $
- */
-package com.gpac.Osmo4.extra;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import android.app.ListActivity;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.ListView;
-import com.gpac.Osmo4.R;
-
-/**
- * @version $Revision: 3371 $
- * 
- */
-public class FileChooserActivity extends ListActivity {
-
-    private File currentDir;
-
-    private FileArrayAdapter adapter;
-
-    /**
-     * The parameter name to use to search for title
-     */
-    public final static String TITLE_PARAMETER = "org.openintents.extra.TITLE"; //$NON-NLS-1$
-
-    private String customTitle;
-
-    private void updateTitle(File currentPath) {
-        setTitle(getResources().getString(R.string.selectFileTitlePattern, customTitle, currentPath.getAbsolutePath()));
-    }
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        Intent intent = getIntent();
-        currentDir = new File("/"); //$NON-NLS-1$
-        this.customTitle = getResources().getString(R.string.selectFileDefaultTitle);
-        if (intent != null) {
-            if (intent.getData() != null) {
-                File f = new File(intent.getData().getPath());
-                if (f.exists() && f.isDirectory() && f.canRead())
-                    currentDir = f;
-            }
-            String title = intent.getExtras().getString(TITLE_PARAMETER);
-            if (title != null)
-                this.customTitle = title;
-        }
-        fillList(currentDir);
-    }
-
-    private void fillList(File f) {
-        File[] dirs = f.listFiles();
-        updateTitle(f);
-        List<FileEntry> dir = new ArrayList<FileEntry>();
-        List<FileEntry> fls = new ArrayList<FileEntry>();
-        if (dirs != null) {
-            for (File ff : dirs) {
-                dir.add(new FileEntry(ff.getAbsoluteFile()));
-            }
-            Collections.sort(dir);
-            Collections.sort(fls);
-            dir.addAll(fls);
-        }
-        if (f.getParentFile() != null)
-            dir.add(0, new FileEntry(f.getParentFile(), getResources().getString(R.string.parentDirectory)));
-        adapter = new FileArrayAdapter(this, R.layout.file_view, dir);
-        this.setListAdapter(adapter);
-    }
-
-    @Override
-    protected void onListItemClick(ListView l, View v, int position, long id) {
-        super.onListItemClick(l, v, position, id);
-        FileEntry o = adapter.getItem(position);
-        if (o.getFile().isDirectory()) {
-            fillList(o.getFile());
-        } else {
-            onFileClick(o);
-        }
-    }
-
-    private void onFileClick(FileEntry o) {
-        Intent data = new Intent();
-        data.setData(Uri.fromFile(o.getFile()));
-        setResult(RESULT_OK, data);
-        finish();
-    }
-
-}
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/extra/FileEntry.java b/applications/osmo4_android/src/com/gpac/Osmo4/extra/FileEntry.java
deleted file mode 100644 (file)
index 40fb567..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * $URL: http://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac/applications/osmo4_android/src/com/gpac/Osmo4/extra/FileEntry.java $
- *
- * $LastChangedBy: enst_devs $ - $LastChangedDate: 2011-07-05 18:35:26 +0200(mar, 05 lug 2011) $
- */
-package com.gpac.Osmo4.extra;
-
-import java.io.File;
-
-/**
- * @version $Revision: 3371 $
- * 
- */
-public class FileEntry implements Comparable<FileEntry> {
-
-    private final File file;
-
-    private final String name;
-
-    /**
-     * Constructor
-     * 
-     * @param f
-     */
-    public FileEntry(File f) {
-        this.file = f;
-        this.name = f.getName();
-    }
-
-    /**
-     * Constructor
-     * 
-     * @param f
-     * @param name The name to use
-     */
-    public FileEntry(File f, String name) {
-        this.file = f.getAbsoluteFile();
-        this.name = name;
-    }
-
-    /**
-     * Get the name of option
-     * 
-     * @return The name of option
-     */
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public int compareTo(FileEntry o) {
-        return getName().toLowerCase().compareTo(o.getName());
-    }
-
-    /**
-     * @return the file
-     */
-    public File getFile() {
-        return file;
-    }
-}
\ No newline at end of file
diff --git a/applications/osmo4_android/src/com/gpac/Osmo4/logs/GpacLogger.java b/applications/osmo4_android/src/com/gpac/Osmo4/logs/GpacLogger.java
deleted file mode 100644 (file)
index 167ca40..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * $URL: http://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac/applications/osmo4_android/src/com/gpac/Osmo4/logs/GpacLogger.java $
- *
- * $LastChangedBy: enst_devs $ - $LastChangedDate: 2011-07-05 18:35:26 +0200(mar, 05 lug 2011) $
- */
-package com.gpac.Osmo4.logs;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.PrintStream;
-import java.util.Date;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import android.util.Log;
-import com.gpac.Osmo4.GpacConfig;
-import com.gpac.Osmo4.GpacCallback.GF_Log_Module;
-
-/**
- * This class handles logging.
- * 
- * It will be extended soon to be configurable and enable saving files on disk
- * 
- * @version $Revision: 3371 $
- * 
- */
-public class GpacLogger {
-
-    /**
-     * Default Constructor
-     * 
-     * @param gpacConfig
-     */
-    public GpacLogger(GpacConfig gpacConfig) {
-        loggedModules.add(GF_Log_Module.GF_LOG_AUDIO);
-        loggedModules.add(GF_Log_Module.GF_LOG_MEDIA);
-        loggedModules.add(GF_Log_Module.GF_LOG_MODULE);
-        loggedModules.add(GF_Log_Module.GF_LOG_CORE);
-        logger = new File(gpacConfig.getGpacCacheDirectory(), "gpac.log"); //$NON-NLS-1$
-    }
-
-    private boolean enableLogOnDisk = false;
-
-    /**
-     * @return the enableLogOnDisk
-     */
-    public synchronized boolean isEnableLogOnDisk() {
-        return enableLogOnDisk;
-    }
-
-    /**
-     * @param enableLogOnDisk the enableLogOnDisk to set
-     */
-    public synchronized void setEnableLogOnDisk(boolean enableLogOnDisk) {
-        this.enableLogOnDisk = enableLogOnDisk;
-    }
-
-    private final File logger;
-
-    /**
-     * Called when creating logger
-     */
-    public void onCreate() {
-        if (!enableLogOnDisk)
-            return;
-        if (writer == null) {
-            try {
-                writer = new PrintStream(new BufferedOutputStream(new FileOutputStream(logger), 128), true, "UTF-8"); //$NON-NLS-1$
-            } catch (Exception e) {
-                Log.e(GpacLogger.class.getSimpleName(), "Failed to create writer", e); //$NON-NLS-1$
-            }
-        }
-        if (writer != null)
-            writer.println("New log $Revision: 3371 $ at " + new Date()); //$NON-NLS-1$
-    }
-
-    /**
-     * Called when stopping logger
-     */
-    public void onDestroy() {
-        if (!enableLogOnDisk)
-            return;
-        PrintStream w = this.writer;
-        writer = null;
-        if (w != null) {
-            w.println("Closing log file at " + new Date()); //$NON-NLS-1$
-            w.close();
-        }
-    }
-
-    /**
-     * Logs from C-code
-     * 
-     * @param level
-     * @param module
-     * @param message
-     */
-    public void onLog(int level, int module, String message) {
-        GF_Log_Module gModule = GF_Log_Module.getModule(module);
-        if (loggedModules.contains(gModule)) {
-            if (loggedLevel <= level)
-                doLog(gModule, level, message);
-        } else if (defaultLoggedLevel <= level) {
-            doLog(gModule, level, message);
-        }
-    }
-
-    private void doLog(GF_Log_Module module, int level, String message) {
-        Log.println(level, module.name(), message);
-        if (enableLogOnDisk) {
-            PrintStream s = writer;
-            if (s != null) {
-                s.println(module.name() + "\t" + message); //$NON-NLS-1$
-                s.flush();
-            }
-        }
-    }
-
-    private final SortedSet<GF_Log_Module> loggedModules = new TreeSet<GF_Log_Module>();
-
-    // The log level used by GPAC modules that are part of loggedModules collection
-    private int loggedLevel = Log.DEBUG;
-
-    // The log level used by GPAC modules not part of loggedModules collection
-    private int defaultLoggedLevel = Log.INFO;
-
-    /**
-     * @return the loggedLevel
-     */
-    public synchronized int getLoggedLevel() {
-        return loggedLevel;
-    }
-
-    /**
-     * @param loggedLevel the loggedLevel to set
-     */
-    public synchronized void setLoggedLevel(int loggedLevel) {
-        this.loggedLevel = loggedLevel;
-    }
-
-    /**
-     * @return the defaultLoggedLevel
-     */
-    public synchronized int getDefaultLoggedLevel() {
-        return defaultLoggedLevel;
-    }
-
-    /**
-     * @param defaultLoggedLevel the defaultLoggedLevel to set
-     */
-    public synchronized void setDefaultLoggedLevel(int defaultLoggedLevel) {
-        this.defaultLoggedLevel = defaultLoggedLevel;
-    }
-
-    private volatile PrintStream writer;
-
-};
diff --git a/applications/osmo4_ios/Resources/icon.png b/applications/osmo4_ios/Resources/icon.png
deleted file mode 100644 (file)
index 13f1dee..0000000
Binary files a/applications/osmo4_ios/Resources/icon.png and /dev/null differ
diff --git a/applications/osmo4_ios/Resources/osmo.icns b/applications/osmo4_ios/Resources/osmo.icns
deleted file mode 100644 (file)
index da7226f..0000000
Binary files a/applications/osmo4_ios/Resources/osmo.icns and /dev/null differ
diff --git a/applications/osmo4_ios/extract.c b/applications/osmo4_ios/extract.c
deleted file mode 100644 (file)
index 4a26b09..0000000
+++ /dev/null
@@ -1,702 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) Jean Le Feuvre 2000-2005
- *                     Copyright (c) 2005-200X ENST
- *                                     All rights reserved
- *
- *  This file is part of GPAC / command-line client
- *
- *  GPAC is gf_free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- */
-
-#include "libgpac_symbols.h"
-
-#ifdef WIN32
-#include <windows.h>
-#else
-typedef struct tagBITMAPFILEHEADER 
-{
-    u16        bfType;
-    u32        bfSize;
-    u16        bfReserved1;
-    u16        bfReserved2;
-    u32 bfOffBits;
-} BITMAPFILEHEADER;
-
-typedef struct tagBITMAPINFOHEADER{
-       u32     biSize;
-       s32     biWidth;
-       s32     biHeight;
-       u16     biPlanes;
-       u16     biBitCount;
-       u32     biCompression;
-       u32     biSizeImage;
-       s32     biXPelsPerMeter;
-       s32     biYPelsPerMeter;
-       u32     biClrUsed;
-       u32     biClrImportant;
-} BITMAPINFOHEADER;
-
-#define BI_RGB        0L
-
-#endif
-
-
-#include <gpac/internal/avilib.h>
-#include <gpac/internal/terminal_dev.h>
-#include <gpac/internal/compositor_dev.h>
-
-extern Bool is_connected;
-extern GF_Terminal *term;
-extern u32 Duration;
-extern GF_Err last_error;
-
-static GFINLINE u8 colmask(s32 a, s32 n)
-{
-    s32 mask = (1 << n) - 1;
-    return (u8) (a & (0xff & ~mask)) | ((-((a >> n) & 1)) & mask);
-}
-
-static u32 put_pixel(FILE *fout, u32 type, u32 pf, char *ptr)
-{
-       u16 col;
-       switch (pf) {
-       case GF_PIXEL_RGB_32:
-       case GF_PIXEL_ARGB:
-               fputc(ptr[0], fout);
-               fputc(ptr[1], fout);
-               fputc(ptr[2], fout);
-               return 4;
-
-       case GF_PIXEL_BGR_32:
-       case GF_PIXEL_RGBA:
-                //probably due to tinygl bug - verify
-#ifndef GPAC_USE_TINYGL
-               fputc(ptr[3], fout);
-               fputc(ptr[2], fout);
-               fputc(ptr[1], fout);
-#else
-               fputc(ptr[2], fout);
-               fputc(ptr[1], fout);
-               fputc(ptr[0], fout);
-#endif
-               return 4;
-
-       case GF_PIXEL_RGB_24:
-               fputc(ptr[2], fout);
-               fputc(ptr[1], fout);
-               fputc(ptr[0], fout);
-               return 3;
-
-       case GF_PIXEL_BGR_24:
-               fputc(ptr[2], fout);
-               fputc(ptr[1], fout);
-               fputc(ptr[0], fout);
-               return 3;
-       case GF_PIXEL_RGB_565:
-               col = * (u16 *)ptr;
-               fputc(colmask(col << 3, 3), fout);
-               fputc(colmask(col >> (5 - 2), 2), fout);
-               fputc(colmask(col >> (11 - 3), 3), fout);
-               return 2;
-
-       case GF_PIXEL_RGB_555:
-               col = * (u16 *)ptr;
-               fputc(colmask(col << 3, 3), fout);
-               fputc(colmask(col >> (5 - 3), 3), fout);
-               fputc(colmask(col >> (10 - 3), 3), fout);
-               return 2;
-       /* this is used to write the byte depthbuffer in greyscale when dumping depth*/ 
-       case GF_PIXEL_GREYSCALE:
-               /* bmp always needs 3 pixels */
-               fputc(ptr[0], fout);
-               fputc(ptr[0], fout);
-               fputc(ptr[0], fout); 
-               /* if printing the characters corresponding to the float depth buffer: */
-               /*
-               {
-               u32 i=0;
-               while (ptr[i]!='\0') {
-                       fputc(ptr[i], fout);
-                       i++;
-               }
-               fputc('\b', fout);
-               }
-               */
-               return 1;
-
-
-       case 0:
-               fputc(ptr[0], fout);
-               return 1;
-       }
-       return 0;
-}
-
-void write_bmp(GF_VideoSurface *fb, char *rad_name, u32 img_num)
-{
-       char str[GF_MAX_PATH];
-       BITMAPFILEHEADER fh;
-       BITMAPINFOHEADER fi;
-       FILE *fout;
-       u32 j, i;
-       char *ptr, *prev;
-
-       prev = strrchr(rad_name, '.');
-       //if (prev) prev[0] = '\0'; 
-
-       if (fb->pixel_format==GF_PIXEL_GREYSCALE) sprintf(str, "%s_%d_depth.bmp", rad_name, img_num);
-       else sprintf(str, "%s_%d.bmp", rad_name, img_num);
-
-       fout = gf_f64_open(str, "wb");
-       if (!fout) return;
-
-       memset(&fh, 0, sizeof(fh));
-       fh.bfType = 19778;
-       fh.bfOffBits = 14 + 40;
-
-       memset(&fi, 0, sizeof(char)*40);
-       fi.biSize = sizeof(char)*40;
-       fi.biWidth = fb->width;
-       fi.biHeight = fb->height;
-       fi.biPlanes = 1;
-       if (fb->pixel_format==GF_PIXEL_GREYSCALE) fi.biBitCount = 24;
-       else fi.biBitCount = 24;
-       fi.biCompression = BI_RGB;
-       fi.biSizeImage = fb->pitch_y * fb->height;
-
-       /*NOT ALIGNED!!*/
-    fwrite(&fh.bfType, 2, 1, fout);
-    fwrite(&fh.bfSize, 4, 1, fout);
-    fwrite(&fh.bfReserved1, 2, 1, fout);
-    fwrite(&fh.bfReserved2, 2, 1, fout);
-    fwrite(&fh.bfOffBits, 4, 1, fout);
-
-       fwrite(&fi, 1, 40, fout);
-//#ifndef GPAC_USE_TINYGL
-       for (j=fb->height; j>0; j--) {
-               ptr = fb->video_buffer + (j-1)*fb->pitch_y;
-               for (i=0;i<fb->width; i++) {
-                       u32 res = put_pixel(fout, 0, fb->pixel_format, ptr);
-                       assert(res);
-                       ptr += res;
-               }
-       }
-//#else
-#if 0
-       for (j=0; j<fb->height; j++) {
-               ptr = fb->video_buffer + j*fb->pitch;
-               for (i=0;i<fb->width; i++) {
-                       u32 res = put_pixel(fout, 0, fb->pixel_format, ptr);
-                       assert(res);
-                       ptr += res;
-               }
-       }
-#endif
-
-       fclose(fout);
-}
-
-/*writes onto a file the content of the framebuffer in *fb interpreted as the byte depthbuffer */
-/*it's also possible to write a float depthbuffer by passing the floats to strings and writing chars in putpixel - see comments*/
-void write_depthfile(GF_VideoSurface *fb, char *rad_name, u32 img_num)
-{
-       FILE *fout;
-       u32 i, j;
-       char val;
-       unsigned char *depth;
-
-       depth = (unsigned char *) fb->video_buffer;
-       
-       fout = gf_f64_open("dump_depth", "wb");
-       if (!fout) return;
-       for (j=0; j<fb->height;  j++) {
-               for (i=0;i<fb->width; i++) {
-
-#ifdef GPAC_USE_TINYGL
-                       val = fputc(depth[2*i+j*fb->width*sizeof(unsigned short)], fout);
-                       val = fputc(depth[2*i+j*fb->width*sizeof(unsigned short) + 1], fout);
-#else
-                       val = fputc(depth[i+j*fb->width], fout);
-#endif
-               }
-       }
-       fclose(fout);
-}
-
-void write_texture_file(GF_VideoSurface *fb, char *rad_name, u32 img_num, u32 dump_mode)
-{
-
-       FILE *fout;
-       u32 i, j;
-       char val;
-       unsigned char *buf;
-
-       buf = (unsigned char *) fb->video_buffer;
-       
-       if (dump_mode==6) fout = gf_f64_open("dump_rgbds", "wb");
-       else if (dump_mode==9) fout = gf_f64_open("dump_rgbd", "wb");
-       else return;
-       
-       if (!fout) return;
-       for (j=0; j<fb->height;  j++) {
-               for (i=0;i<fb->width*4; i++) {
-                       val = fputc(buf[i+j*fb->pitch_y], fout);
-               }
-       }
-       fclose(fout);
-}
-
-
-void write_raw(GF_VideoSurface *fb, char *rad_name, u32 img_num)
-{
-       u32 j, i;
-       char *ptr, *prev;
-       char str[GF_MAX_PATH];
-       FILE *fout;
-       prev = strrchr(rad_name, '.');
-       if (prev) prev[0] = '\0'; 
-       if (img_num<10) {
-               sprintf(str, "%s_00%d.raw", rad_name, img_num);
-       } else if (img_num<100) {
-               sprintf(str, "%s_0%d.raw", rad_name, img_num);
-       } else {
-               sprintf(str, "%s_%d.raw", rad_name, img_num);
-       }
-
-       fout = gf_f64_open(str, "wb");
-       if (!fout) return;
-
-       
-       for (j=0;j<fb->height; j++) {
-               ptr = fb->video_buffer + j*fb->pitch_y;
-               for (i=0;i<fb->width; i++) {
-                       u32 res = put_pixel(fout, 0, fb->pixel_format, ptr);
-                       assert(res);
-                       ptr += res;
-               }
-       }
-       fclose(fout);
-}
-
-
-/* creates a .bmp format greyscale image of the byte depthbuffer and a binary with only the content of the depthbuffer */
-void dump_depth (GF_Terminal *term, char *rad_name, u32 dump_type, u32 frameNum, char *conv_buf, void *avi_out)
-{
-       GF_Err e;
-       u32 i, k;
-       GF_VideoSurface fb;
-
-       /*lock it*/
-       e = gf_sc_get_screen_buffer(term->compositor, &fb, 1);
-       if (e) fprintf(stdout, "Error grabbing depth buffer: %s\n", gf_error_to_string(e));
-       else  fprintf(stdout, "OK\n");
-       /*export frame*/
-       switch (dump_type) {
-       case 1:
-       case 8:
-               /*reverse frame*/
-               for (k=0; k<fb.height; k++) {
-                       char *dst, *src;
-                       u16 src_16;
-                       dst = conv_buf + k*fb.width*3;
-                       src = fb.video_buffer + (fb.height-k-1) * fb.pitch_y;
-                       
-                       for (i=0;i<fb.width; i++) {
-                               switch (fb.pixel_format) {
-                               case GF_PIXEL_RGB_32:
-                               case GF_PIXEL_ARGB:
-                                       dst[0] = src[0];
-                                       dst[1] = src[1];
-                                       dst[2] = src[2];
-                                       src+=4;
-                                       break;
-                       
-                               case GF_PIXEL_BGR_32:
-                               case GF_PIXEL_RGBA:
-                                       dst[0] = src[3];
-                                       dst[1] = src[2];
-                                       dst[2] = src[1];
-                                       src+=4;
-                                       break;
-                               case GF_PIXEL_RGB_24:
-                                       dst[0] = src[2];
-                                       dst[1] = src[1];
-                                       dst[2] = src[0];
-                                       src+=3;
-                                       break;
-                               case GF_PIXEL_BGR_24:
-                                       dst[0] = src[2];
-                                       dst[1] = src[1];
-                                       dst[2] = src[0];
-                                       src+=3;
-                                       break;
-                               case GF_PIXEL_RGB_565:
-                                       src_16 = * ( (u16 *)src );
-                                       dst[2] = colmask(src_16 >> 8/*(11 - 3)*/, 3);
-                                       dst[1] = colmask(src_16 >> 3/*(5 - 2)*/, 2);
-                                       dst[0] = colmask(src_16 << 3, 3);
-                                       src+=2;
-                                       break;
-                               case GF_PIXEL_RGB_555:
-                                       src_16 = * (u16 *)src;
-                                       dst[2] = colmask(src_16 >> 7/*(10 - 3)*/, 3);
-                                       dst[1] = colmask(src_16 >> 2/*(5 - 3)*/, 3);
-                                       dst[0] = colmask(src_16 << 3, 3);
-                                       src+=2;
-                                       break;
-                                       /*for depth .avi*/
-                               case GF_PIXEL_GREYSCALE:
-                                       dst[0] = src[0];
-                                       dst[1] = src[0];
-                                       dst[2] = src[0];
-                                       src+=1;
-                                       break;
-                               }
-                               dst += 3;
-                       }
-               }
-#ifndef GPAC_DISABLE_AVILIB
-               if (AVI_write_frame(avi_out, conv_buf, fb.height*fb.width*3, 1) <0)
-                       printf("Error writing frame\n");
-#endif
-               break;
-       case 2:
-               write_bmp(&fb, rad_name, frameNum);
-               break;
-       case 3:
-               write_raw(&fb, rad_name, frameNum);
-               break;
-       case 4:
-               write_depthfile(&fb, rad_name, frameNum);
-               break;
-       case 7:
-               write_bmp(&fb, rad_name, frameNum);
-               break;  
-               
-       }
-       /*unlock it*/
-       /*in -depth -avi mode, do not release it yet*/
-       if (dump_type!=8) gf_sc_release_screen_buffer(term->compositor, &fb);
-}
-
-void dump_frame(GF_Terminal *term, char *rad_name, u32 dump_type, u32 frameNum, char *conv_buf, void *avi_out)
-{
-       GF_Err e = GF_OK;
-       u32 i, k, out_size;
-       GF_VideoSurface fb;
-
-       /*lock it*/
-       if (dump_type==5 || dump_type==6) e = gf_sc_get_screen_buffer(term->compositor, &fb, 2);
-       else if (dump_type== 9 || dump_type==10) e = gf_sc_get_screen_buffer(term->compositor, &fb, 3);
-       else e = gf_sc_get_screen_buffer(term->compositor, &fb, 0);
-       if (e) fprintf(stdout, "Error grabbing frame buffer: %s\n", gf_error_to_string(e));
-
-       if (dump_type!=5 && dump_type!= 10) { 
-               out_size = fb.height*fb.width*3;
-       } else {
-               out_size = fb.height*fb.width*4;
-       }
-       /*export frame*/
-       switch (dump_type) {
-       case 1:
-       case 5:
-       case 10:
-       case 8:
-               /*reverse frame*/
-               for (k=0; k<fb.height; k++) {
-                       char *dst, *src;
-                       u16 src_16;
-                       if (dump_type==5 || dump_type==10) dst = conv_buf + k*fb.width*4;
-                       else dst = conv_buf + k*fb.width*3;
-                       src = fb.video_buffer + (fb.height-k-1) * fb.pitch_y;
-
-                       switch (fb.pixel_format) {
-                       case GF_PIXEL_RGB_32:
-                       case GF_PIXEL_ARGB:
-                               for (i=0;i<fb.width; i++) {
-                                       dst[0] = src[0];
-                                       dst[1] = src[1];
-                                       dst[2] = src[2];
-                                       src+=4;
-                                       dst += 3;
-                               }
-                               break;
-                       case GF_PIXEL_RGBDS:
-                               for (i=0;i<fb.width; i++) {
-                                       dst[0] = src[2];
-                                       dst[1] = src[1];
-                                       dst[2] = src[0];
-                                       dst[3] = src[3];
-                                       dst +=4;
-                                       src+=4;
-                               }
-                               break;          
-                       case GF_PIXEL_RGBD:
-                               for (i=0;i<fb.width; i++) {
-                                       dst[0] = src[2];
-                                       dst[1] = src[1];
-                                       dst[2] = src[0];
-                                       dst[3] = src[3];
-                                       dst += 4;
-                                       src+=4;
-                               }
-                               break;                          
-                       case GF_PIXEL_BGR_32:
-                       case GF_PIXEL_RGBA:
-                               for (i=0;i<fb.width; i++) {
-                                       dst[0] = src[3];
-                                       dst[1] = src[2];
-                                       dst[2] = src[1];
-                                       src+=4;
-                                       dst+=3;
-                               }
-                               break;
-                       case GF_PIXEL_RGB_24:
-                               for (i=0;i<fb.width; i++) {
-                                       dst[0] = src[2];
-                                       dst[1] = src[1];
-                                       dst[2] = src[0];
-                                       src+=3;
-                                       dst+=3;
-                               }
-                               break;
-                       case GF_PIXEL_BGR_24:
-                               for (i=0;i<fb.width; i++) {
-                                       dst[0] = src[2];
-                                       dst[1] = src[1];
-                                       dst[2] = src[0];
-                                       src+=3;
-                                       dst+=3;
-                               }
-                               break;
-                       case GF_PIXEL_RGB_565:
-                               for (i=0;i<fb.width; i++) {
-                                       src_16 = * ( (u16 *)src );
-                                       dst[2] = colmask(src_16 >> 8/*(11 - 3)*/, 3);
-                                       dst[1] = colmask(src_16 >> 3/*(5 - 2)*/, 2);
-                                       dst[0] = colmask(src_16 << 3, 3);
-                                       src+=2;
-                                       dst+=3;
-                               }
-                               break;
-                       case GF_PIXEL_RGB_555:
-                               for (i=0;i<fb.width; i++) {
-                                       src_16 = * (u16 *)src;
-                                       dst[2] = colmask(src_16 >> 7/*(10 - 3)*/, 3);
-                                       dst[1] = colmask(src_16 >> 2/*(5 - 3)*/, 3);
-                                       dst[0] = colmask(src_16 << 3, 3);
-                                       src+=2;
-                                       dst +=3;
-                               }
-                               break;
-                       }
-               }
-#ifndef GPAC_DISABLE_AVILIB
-               if (dump_type!=5 && dump_type!= 10) { 
-                       if (AVI_write_frame(avi_out, conv_buf, out_size, 1) <0)
-                       printf("Error writing frame\n");
-               } else {
-                       if (AVI_write_frame(avi_out, conv_buf, out_size, 1) <0)
-                       printf("Error writing frame\n");                                
-               }
-#endif
-               break;
-       case 2:
-               write_bmp(&fb, rad_name, frameNum);
-               break;
-       case 6:
-       case 9:
-               write_texture_file(&fb, rad_name, frameNum, dump_type);
-               break;
-       
-       case 3:
-               write_raw(&fb, rad_name, frameNum);
-               break;
-       }
-       /*unlock it*/
-       gf_sc_release_screen_buffer(term->compositor, &fb);
-}
-
-Bool dump_file(char *url, u32 dump_mode, Double fps, u32 width, u32 height, Float scale, u32 *times, u32 nb_times)
-{
-       GF_Err e;
-       u32 i = 0;
-       GF_VideoSurface fb;
-       char szPath[GF_MAX_PATH];
-       char *prev=NULL;  
-
-       prev = strstr(url, "://");
-       if (prev) {
-               prev = strrchr(url, '/');
-               if (prev) prev++;
-       }
-
-       if (!prev) prev = url; 
-       strcpy(szPath, prev);
-       prev = strrchr(szPath, '.');
-       if (prev) prev[0] = 0;
-
-       fprintf(stdout, "Opening URL %s\n", url);
-       /*connect in pause mode*/
-       gf_term_connect_from_time(term, url, 0, 1);
-
-       while (!term->compositor->scene 
-               || term->compositor->msg_type
-               || (gf_term_get_option(term, GF_OPT_PLAY_STATE) == GF_STATE_STEP_PAUSE)
-       ) {
-               if (last_error) return 1;
-               gf_term_process_flush(term);
-               gf_sleep(10);
-       }
-       
-       if (width && height) {
-               gf_term_set_size(term, width, height);
-               gf_term_process_flush(term);
-       } 
-#ifndef GPAC_USE_TINYGL
-        printf("not tinygl\n");
-       e = gf_sc_get_screen_buffer(term->compositor, &fb, 0);
-#else
-        printf("tinygl\n");
-       e = gf_sc_get_screen_buffer(term->compositor, &fb, 1);
-#endif
-       if (e != GF_OK) {
-               fprintf(stdout, "Error grabbing screen buffer: %s\n", gf_error_to_string(e));
-               return 0;
-       }
-       width = fb.width;
-       height = fb.height;
-       gf_sc_release_screen_buffer(term->compositor, &fb);
-
-       if (scale != 1) {
-               width = (u32)(width * scale);
-               height = (u32)(height * scale);
-               gf_term_set_size(term, width, height);
-               gf_term_process_flush(term);
-       }
-
-       /*we work in RGB24, and we must make sure the pitch is %4*/
-       if ((width*3)%4) {
-               fprintf(stdout, "Adjusting width (%d) to have a stride multiple of 4\n", width);
-               while ((width*3)%4) width--;
-
-               gf_term_set_size(term, width, height);
-               gf_term_process_flush(term);
-
-               gf_sc_get_screen_buffer(term->compositor, &fb, 0);
-               width = fb.width;
-               height = fb.height;
-               gf_sc_release_screen_buffer(term->compositor, &fb);
-       }
-
-       if (dump_mode==1 || dump_mode==5 || dump_mode==8 || dump_mode==10) {
-#ifdef GPAC_DISABLE_AVILIB
-               fprintf(stdout, "AVILib is disabled in this build of GPAC\n");
-               return 0;
-#else
-               u32 time, prev_time, nb_frames, dump_dur;
-               char *conv_buf;
-               avi_t *avi_out = NULL; 
-               avi_t *depth_avi_out = NULL; 
-               char szPath_depth[GF_MAX_PATH];
-               char comp[5];
-               strcpy(szPath_depth, szPath);
-               strcat(szPath, ".avi");
-               avi_out = AVI_open_output_file(szPath);
-               if (!avi_out) {
-                       fprintf(stdout, "Error creating AVI file %s\n", szPath);
-                       return 1;
-               }
-               if (dump_mode==8) {
-                       strcat(szPath_depth, "_depth.avi");
-                       depth_avi_out = AVI_open_output_file(szPath_depth);
-                       if (!depth_avi_out) {
-                               fprintf(stdout, "Error creating AVI file %s\n", szPath);
-                               return 1;
-                       }       
-               }
-               
-               if (!fps) fps = 25.0;
-               time = prev_time = 0;
-               nb_frames = 0;
-
-               if (nb_times==2) {
-                       prev_time = times[0];
-                       dump_dur = times[1] - times[0];
-               } else {
-                       dump_dur = times[0] ? times[0] : Duration;
-               }
-               if (!dump_dur) {
-                       fprintf(stdout, "Warning: file has no duration, defaulting to 1 sec\n");
-                       dump_dur = 1000;
-               }
-
-               comp[0] = comp[1] = comp[2] = comp[3] = comp[4] = 0;
-               AVI_set_video(avi_out, width, height, fps, comp);
-               if (dump_mode==8) AVI_set_video(depth_avi_out, width, height, fps, comp);
-               if (dump_mode != 5 && dump_mode!=10) conv_buf = gf_malloc(sizeof(char) * width * height * 3);
-               else conv_buf = gf_malloc(sizeof(char) * width * height * 4);
-               /*step to first frame*/
-               if (prev_time) gf_term_step_clocks(term, prev_time);
-
-               while (time < dump_dur) {
-                       while ((gf_term_get_option(term, GF_OPT_PLAY_STATE) == GF_STATE_STEP_PAUSE)) {
-                               gf_term_process_flush(term);
-                       }
-                       fprintf(stdout, "Dumping %02d/100\r", (u32) ((100.0*prev_time)/dump_dur) );
-
-                       if (dump_mode==8) {
-                               /*we'll dump both buffers at once*/
-                               gf_mx_p(term->compositor->mx);
-                               dump_depth(term, szPath_depth, dump_mode, i+1, conv_buf, depth_avi_out);
-                               dump_frame(term, szPath, dump_mode, i+1, conv_buf, avi_out);
-                               gf_mx_v(term->compositor->mx);
-
-                       }
-                       else dump_frame(term, szPath, dump_mode, i+1, conv_buf, avi_out);
-                       
-                       nb_frames++;
-                       time = (u32) (nb_frames*1000/fps);
-                       gf_term_step_clocks(term, time - prev_time);
-                       prev_time = time;
-               }
-               AVI_close(avi_out);
-               if (dump_mode==8) AVI_close(depth_avi_out);
-               gf_free(conv_buf);
-               fprintf(stdout, "AVI Extraction 100/100\n");
-#endif /*GPAC_DISABLE_AVILIB*/
-       } else {
-               if (times[0]) gf_term_step_clocks(term, times[0]);
-
-               for (i=0; i<nb_times; i++) {
-                       while ((gf_term_get_option(term, GF_OPT_PLAY_STATE) == GF_STATE_STEP_PAUSE)) {
-                               gf_term_process_flush(term);
-                       }
-
-                       if (dump_mode==4 || dump_mode==7) {
-                               dump_depth(term, szPath, dump_mode, i+1, NULL, NULL);
-                       } else {
-                               dump_frame(term, url, dump_mode, i+1, NULL, NULL);
-                       }
-                       
-                       if (i+1<nb_times) gf_term_step_clocks(term, times[i+1] - times[i]);
-               }
-       }
-       return 0;
-}
-
diff --git a/applications/osmo4_ios/main.c b/applications/osmo4_ios/main.c
deleted file mode 100644 (file)
index 75955cd..0000000
+++ /dev/null
@@ -1,2145 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) Jean Le Feuvre 2000-2005
- *                                     All rights reserved
- *
- *  This file is part of GPAC / command-line client
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- */
-
-
-#include "libgpac_symbols.h"
-void (*gf_log_lt)(u32 ll, u32 lt);
-int (*AVI_close)(avi_t *AVI);
-GF_Err (*gf_term_del)(GF_Terminal *term);
-void (*gf_sleep)(u32 ms);
-GF_Err (*gf_sc_release_screen_buffer)(GF_Compositor *sr, GF_VideoSurface *framebuffer);
-char (*gf_prompt_get_char)();
-void (*gf_set_progress)(char *title, u32 done, u32 total);
-GF_Terminal *(*gf_term_new)(GF_User *user);
-GF_Err (*gf_term_process_step)(GF_Terminal *term);
-GF_Err (*gf_sc_get_screen_buffer)(GF_Compositor *sr, GF_VideoSurface *framebuffer, Bool depth_buffer);
-void (*gf_iphone_set_sdl_audio_module)(void* (*SDL_Module) (void));
-GF_Err (*gf_term_step_clocks)(GF_Terminal * term, u32 ms_diff);
-void (*gf_prompt_set_echo_off)(Bool echo_off);
-u32 (*gf_log_get_tools)();
-u32 (*gf_log_get_level)();
-GF_Err (*gf_cfg_set_key)(GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue);
-u32 (*gf_cfg_get_section_count)(GF_Config *cfgFile);
-GF_Err (*gf_term_get_service_info)(GF_Terminal *term, GF_ObjectManager *odm, NetInfoCommand *netcom);
-GF_Err (*gf_term_set_size)(GF_Terminal *term, u32 NewWidth, u32 NewHeight);
-Bool (*gf_sys_get_rti)(u32 refresh_time_ms, GF_SystemRTInfo *rti, u32 flags);
-void (*gf_log_set_tools)(u32 tools);
-u32 (*gf_term_play_from_time)(GF_Terminal *term, u64 from_time, u32 pause_at_first_frame);
-void *(*gf_malloc)(size_t size);
-void (*gf_log_set_level)(u32 level);
-void (*gf_iphone_set_sdl_video_module)(void* (*SDL_Module) (void));
-u32 (*gf_term_get_option)(GF_Terminal *term, u32 opt_type);
-Bool (*gf_term_user_event)(GF_Terminal *term, GF_Event *event);
-const char *(*gf_modules_get_file_name)(GF_ModuleManager *pm, u32 index);
-GF_Mutex *(*gf_mx_new)(const char *name);
-u32 (*gf_list_count)(GF_List *ptr);
-void (*gf_free)(void *ptr);
-const char *(*gf_term_get_world_info)(GF_Terminal *term, GF_ObjectManager *scene_od, GF_List *descriptions);
-const char *(*gf_cfg_get_section_name)(GF_Config *cfgFile, u32 secIndex);
-void (*gf_term_navigate_to)(GF_Terminal *term, const char *toURL);
-void (*gf_modules_del)(GF_ModuleManager *pm);
-GF_ModuleManager *(*gf_modules_new)(const char *directory, GF_Config *cfgFile);
-void (*gf_sys_init)(Bool enable_memory_tracker);
-void (*gf_log)(const char *fmt, ...);
-GF_Err (*gf_term_get_object_info)(GF_Terminal *term, GF_ObjectManager *odm, GF_MediaInfo *info);
-u32 (*gf_mx_p)(GF_Mutex *mx);
-u32 (*gf_mx_v)(GF_Mutex *mx);
-void (*gf_mx_del)(GF_Mutex *mx);
-GF_Err (*gf_term_process_flush)(GF_Terminal *term);
-const char *(*gf_cfg_get_key_name)(GF_Config *cfgFile, const char *secName, u32 keyIndex);
-int (*AVI_write_frame)(avi_t *AVI, char *data, long bytes, int keyframe);
-void (*gf_cfg_del)(GF_Config *iniFile);
-Bool (*gf_term_get_channel_net_info)(GF_Terminal *term, GF_ObjectManager *odm, u32 *d_enum, u32 *chid, NetStatCommand *netcom, GF_Err *ret_code);
-void (*gf_term_process_shortcut)(GF_Terminal *term, GF_Event *ev);
-GF_Config *(*gf_cfg_init)(const char *fileName, Bool *is_new);
-Bool (*gf_term_get_download_info)(GF_Terminal *term, GF_ObjectManager *odm, u32 *d_enum, const char **server, const char **path, u32 *bytes_done, u32 *total_bytes, u32 *bytes_per_sec);
-u32 (*gf_sys_clock)();
-GF_ObjectManager *(*gf_term_get_object)(GF_Terminal *term, GF_ObjectManager *scene_od, u32 index);
-GF_Err (*gf_term_set_option)(GF_Terminal *term, u32 opt_type, u32 opt_value);
-void (*gf_sys_close)();
-void (*gf_term_connect_from_time)(GF_Terminal *term, const char *URL, u64 time_in_ms, Bool pause_at_first_frame);
-avi_t* (*AVI_open_output_file)(char * filename);
-const char *(*gf_cfg_get_key)(GF_Config *cfgFile, const char *secName, const char *keyName);
-void (*AVI_set_video)(avi_t *AVI, int width, int height, double fps, char *compressor);
-void (*gf_term_set_speed)(GF_Terminal *term, Fixed speed);
-u32 (*gf_cfg_get_key_count)(GF_Config *cfgFile, const char *secName);
-u32 (*gf_term_object_subscene_type)(GF_Terminal *term, GF_ObjectManager *odm);
-Double (*gf_term_get_framerate)(GF_Terminal *term, Bool absoluteFPS);
-const char *(*gf_error_to_string)(GF_Err e);
-GF_Err (*gf_stretch_bits)(GF_VideoSurface *dst, GF_VideoSurface *src, GF_Window *dst_wnd, GF_Window *src_wnd, u8 alpha, Bool flip, GF_ColorKey *colorKey, GF_ColorMatrix * cmat);
-void (*gf_list_del)(GF_List *ptr);
-void *(*gf_list_get)(GF_List *ptr, u32 itemNumber);
-void (*gf_term_disconnect)(GF_Terminal *term);
-Bool (*gf_term_is_supported_url)(GF_Terminal *term, const char *fileName, Bool use_parent_url, Bool no_mime_check);
-GF_List *(*gf_list_new)(void);
-const char *(*gf_modules_get_option)(GF_BaseInterface *interface_obj, const char *secName, const char *keyName);
-GF_Err (*gf_term_dump_scene)(GF_Terminal *term, char *rad_name, char **filename, Bool xml_dump, Bool skip_proto, GF_ObjectManager *odm);
-Bool (*gf_prompt_has_input)();
-GF_Err (*gf_term_scene_update)(GF_Terminal *term, char *type, char *com);
-void (*gf_term_connect)(GF_Terminal *term, const char *URL);
-u32 (*gf_term_get_object_count)(GF_Terminal *term, GF_ObjectManager *scene_od);
-u32 (*gf_modules_get_count)(GF_ModuleManager *pm);
-GF_ObjectManager *(*gf_term_get_root_object)(GF_Terminal *term);
-u32 (*gf_term_get_time_in_ms)(GF_Terminal *term);
-void (*gf_term_connect_with_path)(GF_Terminal *term, const char *URL, const char *parent_URL);
-gf_log_cbk (*gf_log_set_callback)(void *usr_cbk, gf_log_cbk cbk);
-u32 (*gf_log_parse_tools)(const char *val);
-u32 (*gf_log_parse_level)(const char *val);
-void (*gf_term_switch_quality)(GF_Terminal *term, Bool up);
-GF_Err (*gf_term_release_screen_buffer)(GF_Terminal *term, GF_VideoSurface *framebuffer);
-GF_Err (*gf_term_get_screen_buffer)(GF_Terminal *term, GF_VideoSurface *framebuffer);
-FILE *(*gf_f64_open)(const char *file_name, const char *mode);
-GF_Err (*gf_img_png_enc)(char *data, u32 width, u32 height, s32 stride, u32 pixel_format, char *dst, u32 *dst_size);
-u32 (*utf8_to_ucs4)(u32 *ucs4_buf, u32 utf8_len, unsigned char *utf8_buf);
-
-#ifndef WIN32
-#include <pwd.h>
-#include <unistd.h>
-
-#else
-#include <windows.h> /*for GetModuleFileName*/
-#include <direct.h>  /*for _mkdir*/
-#include <shlobj.h>  /*for getting user-dir*/
-#ifndef SHGFP_TYPE_CURRENT
-#define SHGFP_TYPE_CURRENT 0 /*needed for MinGW*/
-#endif
-
-#ifdef _MSC_VER 
-/*get rid of console*/
-#if 0
-#pragma comment(linker,"/SUBSYSTEM:WINDOWS")
-#pragma comment(linker,"/ENTRY:main")
-#else
-#pragma comment(linker,"/SUBSYSTEM:CONSOLE") 
-#endif
-
-#endif // _MSC_VER
-
-#endif //WIN32
-
-
-/*local prototypes*/
-void PrintWorldInfo(GF_Terminal *term);
-void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number);
-void PrintODList(GF_Terminal *term, GF_ObjectManager *root_odm, u32 num, u32 indent, char *root_name);
-
-void ViewODs(GF_Terminal *term, Bool show_timing);
-void PrintGPACConfig();
-
-static Bool restart = 0;
-#if defined(__DARWIN__) || defined(__APPLE__)
-static Bool not_threaded = 1;
-#else
-static Bool not_threaded = 0;
-#endif
-static Bool no_audio = 0;
-static Bool no_regulation = 0;
-static Bool bench_mode = 0;
-Bool is_connected = 0;
-Bool startup_file = 0;
-GF_User user;
-GF_Terminal *term;
-u64 Duration;
-GF_Err last_error = GF_OK;
-
-static Fixed bench_speed = FLT2FIX(20);
-
-static Bool request_next_playlist_item = 0;
-
-static GF_Config *cfg_file;
-static Bool display_rti = 0;
-static Bool Run;
-static Bool CanSeek = 0;
-static u32 Volume=100;
-static char the_url[GF_MAX_PATH];
-static char pl_path[GF_MAX_PATH];
-static Bool no_mime_check = 1;
-static Bool be_quiet = 0;
-static u32 log_time_start = 0;
-
-static u32 forced_width=0;
-static u32 forced_height=0;
-
-/*windowless options*/
-u32 align_mode = 0;
-u32 init_w = 0;
-u32 init_h = 0;
-u32 last_x, last_y;
-Bool right_down = 0;
-
-void dump_frame(GF_Terminal *term, char *rad_path, u32 dump_type, u32 frameNum);
-Bool dump_file(char *the_url, u32 dump_mode, Double fps, u32 width, u32 height, Float scale, u32 *times, u32 nb_times);
-
-void PrintUsage()
-{
-       fprintf(stdout, "Usage Osmo4iOS [options] [filename]\n"
-               "\t-c fileName:    user-defined configuration file\n"
-               "\t-rti fileName:  logs run-time info (FPS, CPU, Mem usage) to file\n"
-               "\t-rtix fileName: same as -rti but driven by GPAC logs\n"
-               "\t-quiet:         removes script message, buffering and downloading status\n"
-               "\t-opt option:    Overrides an option in the configuration file. String format is section:key=value\n"
-               "\t-log-file file: sets output log file.\n"
-               "\t-log-level lev: sets log level. Possible values are:\n"
-               "\t        \"error\"      : logs only error messages\n"
-               "\t        \"warning\"    : logs error+warning messages\n"
-               "\t        \"info\"       : logs error+warning+info messages\n"
-               "\t        \"debug\"      : logs all messages\n"
-               "\n"
-               "\t-log-tools lt:  sets tool(s) to log. List of \':\'-separated values:\n"
-               "\t        \"core\"       : libgpac core\n"
-               "\t        \"coding\"     : bitstream formats (audio, video, scene)\n"
-               "\t        \"container\"  : container formats (ISO File, MPEG-2 TS, AVI, ...)\n"
-               "\t        \"network\"    : network data exept RTP trafic\n"
-               "\t        \"rtp\"        : rtp trafic\n"
-               "\t        \"author\"     : authoring tools (hint, import, export)\n"
-               "\t        \"sync\"       : terminal sync layer\n"
-               "\t        \"codec\"      : terminal codec messages\n"
-               "\t        \"parser\"     : scene parsers (svg, xmt, bt) and other\n"
-               "\t        \"media\"      : terminal media object management\n"
-               "\t        \"scene\"      : scene graph and scene manager\n"
-               "\t        \"script\"     : scripting engine messages\n"
-               "\t        \"interact\"   : interaction engine (events, scripts, etc)\n"
-               "\t        \"compose\"    : composition engine (2D, 3D, etc)\n"
-               "\t        \"service\"    : network service management\n"
-               "\t        \"mmio\"       : Audio/Video HW I/O management\n"
-               "\t        \"none\"       : no tool logged\n"
-               "\t        \"all\"        : all tools logged\n"
-               "\n"
-               "\t-size WxH:      specifies visual size (default: scene size)\n"
-               "\t-scale s:      scales the visual size (default: 1)\n"
-#if defined(__DARWIN__) || defined(__APPLE__)
-               "\t-thread:        enables thread usage for terminal and compositor \n"
-#else
-               "\t-no-thread:     disables thread usage (except for audio)\n"
-#endif
-               "\t-no-audio:      disables audio \n"
-               "\t-no-wnd:        uses windowless mode (Win32 only)\n"
-               "\t-align vh:      specifies v and h alignment for windowless mode\n"
-               "                   possible v values: t(op), m(iddle), b(ottom)\n"
-               "                   possible h values: l(eft), m(iddle), r(ight)\n"
-               "                   default alignment is top-left\n"
-               "                   default alignment is top-left\n"
-               "\t-pause:         pauses at first frame\n"
-               "\n"
-               "Dumper Options:\n"
-               "\t-bmp [times]:   dumps given frames to bmp\n"
-               "\t-raw [times]:   dumps given frames to bmp\n"
-               "\t-avi [times]:   dumps given file to raw avi\n"
-               "\t-rgbds:         dumps the RGBDS pixel format texture\n"
-               "                   with -avi [times]: dumps an rgbds-format .avi\n"
-               "\t-rgbd:          dumps the RGBD pixel format texture\n"
-               "                                       with -avi [times]: dumps an rgbd-format .avi\n"         
-               "\t-depth:         dumps depthmap (z-buffer) frames\n"
-               "                   with -avi [times]: dumps depthmap in grayscale .avi\n"              
-               "                   with -bmp: dumps depthmap in grayscale .bmp\n"              
-               "\t-fps FPS:       specifies frame rate for AVI dumping (default: 25.0)\n"
-               "\t-2d:            uses 2D compositor\n"
-               "\t-3d:            uses 3D compositor\n"
-               "\t-fill:          uses fill aspect ratio for dumping (default: none)\n"
-               "\t-show:          show window while dumping (default: no)\n"
-               "MP4Client - GPAC command line player and dumper - version %s\n"
-               "GPAC Written by Jean Le Feuvre (c) 2001-2005 - ENST (c) 2005-200X\n",
-
-               GPAC_FULL_VERSION
-               );
-}
-
-void PrintHelp()
-{
-       fprintf(stdout, "MP4Client command keys:\n"
-               "\to: connect to the specified URL\n"
-               "\tO: connect to the specified URL in playlist mode\n"
-               "\tN: switch to the next URL in the playlist (works with return key as well)\n"
-               "\tr: restart current presentation\n"
-               "\tp: play/pause the presentation\n"
-               "\ts: step one frame ahead\n"
-               "\tz: seek into presentation\n"
-               "\tt: print current timing\n"
-               "\n"
-               "\tw: view world info\n"
-               "\tv: view Object Descriptor list\n"
-               "\ti: view Object Descriptor info (by ID)\n"
-               "\tj: view Object Descriptor info (by number)\n"
-               "\tb: view media objects timing and buffering info\n"
-               "\tm: view media objects buffering and memory info\n"
-               "\td: dumps scene graph\n"
-               "\n"
-               "\tC: Enable Streaming Cache\n"
-               "\tS: Stops Streaming Cache and save to file\n"
-               "\tA: Aborts Streaming Cache\n"
-               "\n"
-               "\tk: turns stress mode on/off\n"
-               "\tn: changes navigation mode\n"
-               "\tx: reset to last active viewpoint\n"
-               "\n"
-               "\t2: restart using 2D compositor\n"
-               "\t3: restart using 3D compositor\n"
-               "\n"
-               "\t4: forces 4/3 Aspect Ratio\n"
-               "\t5: forces 16/9 Aspect Ratio\n"
-               "\t6: forces no Aspect Ratio (always fill screen)\n"
-               "\t7: forces original Aspect Ratio (default)\n"
-               "\n"
-               "\tL: changes to new log level. CF MP4Client usage for possible values\n"
-               "\tT: select new tools to log. CF MP4Client usage for possible values\n"
-               "\n"
-               "\tl: list available modules\n"
-               "\tc: prints some GPAC configuration info\n"
-               "\tR: toggles run-time info display on/off\n"
-               "\tq: exit the application\n"
-               "\th: print this message\n"
-               "\n"
-               "MP4Client - GPAC command line player - version %s\n"
-               "GPAC Written by Jean Le Feuvre (c) 2001-2005 - ENST (c) 2005-200X\n",
-
-               GPAC_FULL_VERSION
-               );
-}
-
-
-static void PrintTime(u64 time)
-{
-       u32 ms, h, m, s;
-       h = (u32) (time / 1000 / 3600);
-       m = (u32) (time / 1000 / 60 - h*60);
-       s = (u32) (time / 1000 - h*3600 - m*60);
-       ms = (u32) (time - (h*3600 + m*60 + s) * 1000);
-       fprintf(stdout, "%02d:%02d:%02d.%02d", h, m, s, ms);
-}
-
-
-static u32 rti_update_time_ms = 200;
-static FILE *rti_logs = NULL;
-static u64 memory_at_gpac_startup = 0;
-
-static void UpdateRTInfo(const char *legend)
-{
-       GF_SystemRTInfo rti;
-
-       /*refresh every second*/
-       if (!display_rti && !rti_logs) return;
-       if (!gf_sys_get_rti(rti_update_time_ms, &rti, 0) && !legend) 
-               return;
-
-       if (display_rti) {
-               if (!rti.process_memory) rti.process_memory = (u32) (memory_at_gpac_startup-rti.physical_memory_avail);
-               if (!rti.gpac_memory) rti.gpac_memory = (u32) (memory_at_gpac_startup-rti.physical_memory_avail);
-
-               if (display_rti==2) {
-                       fprintf(stdout, "FPS %02.2f - CPU %02d (%02d) - Mem %d kB\r", 
-                               gf_term_get_framerate(term, 0), rti.total_cpu_usage, rti.process_cpu_usage, (u32) (rti.gpac_memory / 1024) );
-               } else {
-                       char szMsg[1024];
-                       GF_Event evt;
-
-                       sprintf(szMsg, "FPS %02.2f - CPU %02d (%02d) - Mem %d kB", 
-                               gf_term_get_framerate(term, 0), rti.total_cpu_usage, rti.process_cpu_usage, (u32) (rti.gpac_memory / 1024) );
-                       evt.type = GF_EVENT_SET_CAPTION;
-                       evt.caption.caption = szMsg;
-                       gf_term_user_event(term, &evt);
-               }
-       }
-       if (rti_logs) {
-               fprintf(rti_logs, "% 8d\t% 8d\t% 8d\t% 4d\t% 8d\t%s", 
-                       gf_sys_clock(),
-                       gf_term_get_time_in_ms(term),
-                       rti.total_cpu_usage,
-                       (u32) gf_term_get_framerate(term, 0),
-                       (u32) (rti.gpac_memory / 1024), 
-                       legend ? legend : ""
-                       );
-               if (!legend) fprintf(rti_logs, "\n");
-       }
-}
-
-static void ResetCaption()
-{
-       GF_Event event;
-       if (display_rti) return;
-       event.type = GF_EVENT_SET_CAPTION;
-       if (is_connected) {
-               char szName[1024];
-               NetInfoCommand com;
-
-               event.caption.caption = NULL;
-               /*get any service info*/
-               if (!startup_file && gf_term_get_service_info(term, gf_term_get_root_object(term), &com) == GF_OK) {
-                       strcpy(szName, "");
-                       if (com.track_info) { 
-                               char szBuf[10];
-                               sprintf(szBuf, "%02d ", (u32) (com.track_info>>16) );
-                               strcat(szName, szBuf);
-                       }
-                       if (com.artist) { strcat(szName, com.artist); strcat(szName, " "); }
-                       if (com.name) { strcat(szName, com.name); strcat(szName, " "); }
-                       if (com.album) { strcat(szName, "("); strcat(szName, com.album); strcat(szName, ")"); }
-                       
-                       if (strlen(szName)) event.caption.caption = szName;
-               }
-               if (!event.caption.caption) {
-                       char *str = strrchr(the_url, '\\');
-                       if (!str) str = strrchr(the_url, '/');
-                       event.caption.caption = str ? str+1 : the_url;
-               }
-       } else {
-               event.caption.caption = "GPAC MP4Client " GPAC_FULL_VERSION;
-       }
-       gf_term_user_event(term, &event);
-}
-
-#ifdef WIN32
-u32 get_sys_col(int idx)
-{
-       u32 res;
-       DWORD val = GetSysColor(idx);
-       res = (val)&0xFF; res<<=8;
-       res |= (val>>8)&0xFF; res<<=8;
-       res |= (val>>16)&0xFF;
-       return res;
-}
-#endif
-
-void switch_bench()
-{
-       if (is_connected) {
-               bench_mode = !bench_mode;
-               display_rti = !display_rti;
-               ResetCaption();
-               gf_term_set_speed(term, bench_mode ? bench_speed : FIX_ONE);
-       }
-}
-
-Bool GPAC_EventProc(void *ptr, GF_Event *evt)
-{
-       if (!term) return 0;
-
-       switch (evt->type) {
-       case GF_EVENT_DURATION:
-               Duration = 1000;
-               Duration = (u64) (((s64) Duration) * evt->duration.duration);
-               CanSeek = evt->duration.can_seek;
-               break;
-       case GF_EVENT_MESSAGE:
-       {
-               const char *servName;
-               if (!evt->message.service || !strcmp(evt->message.service, the_url)) {
-                       servName = "main service";
-               } else if (!strnicmp(evt->message.service, "data:", 5)) {
-                       servName = "";
-               } else {
-                       servName = evt->message.service;
-               }
-               if (!evt->message.message) return 0;
-               if (evt->message.error==GF_SCRIPT_INFO) {
-                       GF_LOG(GF_LOG_INFO, GF_LOG_SCRIPT, ("[Script] %s\n", evt->message.message));
-                       fprintf(stderr, "%s\n", evt->message.message);
-               } else if (evt->message.error) {
-                       if (!is_connected) last_error = evt->message.error;
-                       fprintf(stderr, "%s (%s): %s\n", evt->message.message, servName, gf_error_to_string(evt->message.error));
-               } else if (!be_quiet) 
-                       fprintf(stderr, "(%s) %s\r", servName, evt->message.message);
-       }
-               break;
-       case GF_EVENT_PROGRESS:
-       {
-               char *szTitle = "";
-               if (evt->progress.progress_type==0) szTitle = "Buffer ";
-               else if (evt->progress.progress_type==1) szTitle = "Download ";
-               else if (evt->progress.progress_type==2) szTitle = "Import ";
-               gf_set_progress(szTitle, evt->progress.done, evt->progress.total);
-       }
-               break;
-       
-
-       case GF_EVENT_DBLCLICK:
-               gf_term_set_option(term, GF_OPT_FULLSCREEN, !gf_term_get_option(term, GF_OPT_FULLSCREEN));
-               return 0;
-
-       case GF_EVENT_MOUSEDOWN:
-               if (evt->mouse.button==GF_MOUSE_RIGHT) {
-                       right_down = 1;
-                       last_x = evt->mouse.x;
-                       last_y = evt->mouse.y;
-               }
-               return 0;
-       case GF_EVENT_MOUSEUP:
-               if (evt->mouse.button==GF_MOUSE_RIGHT) {
-                       right_down = 0;
-                       last_x = evt->mouse.x;
-                       last_y = evt->mouse.y;
-               }
-               return 0;
-       case GF_EVENT_MOUSEMOVE:
-               if (right_down && (user.init_flags & GF_TERM_WINDOWLESS) ) {
-                       GF_Event move;
-                       move.move.x = evt->mouse.x - last_x;
-                       move.move.y = last_y-evt->mouse.y;
-                       move.type = GF_EVENT_MOVE;
-                       move.move.relative = 1;
-                       gf_term_user_event(term, &move);
-               }
-               return 0;
-
-       case GF_EVENT_KEYUP:
-               switch (evt->key.key_code) {
-               case GF_KEY_SPACE:
-                       if (evt->key.flags & GF_KEY_MOD_CTRL) switch_bench();
-                       break;
-               }
-               break;
-       case GF_EVENT_KEYDOWN:
-               gf_term_process_shortcut(term, evt);
-               switch (evt->key.key_code) {
-               case GF_KEY_SPACE:
-                       if (evt->key.flags & GF_KEY_MOD_CTRL) {
-                               /*ignore key repeat*/
-                               if (!bench_mode) switch_bench();
-                       }
-                       break;
-               case GF_KEY_PAGEDOWN:
-               case GF_KEY_MEDIANEXTTRACK:
-                       request_next_playlist_item = 1;
-                       break;
-               case GF_KEY_MEDIAPREVIOUSTRACK:
-                       break;
-               case GF_KEY_ESCAPE:
-                       gf_term_set_option(term, GF_OPT_FULLSCREEN, !gf_term_get_option(term, GF_OPT_FULLSCREEN));
-                       break;
-               case GF_KEY_F:
-                       if (evt->key.flags & GF_KEY_MOD_CTRL) fprintf(stderr, "Rendering rate: %f FPS\n", gf_term_get_framerate(term, 0));
-                       break;
-               case GF_KEY_T:
-                       if (evt->key.flags & GF_KEY_MOD_CTRL) fprintf(stderr, "Scene Time: %f \n", gf_term_get_time_in_ms(term)/1000.0);
-                       break;
-               case GF_KEY_D:
-                       if (evt->key.flags & GF_KEY_MOD_CTRL) gf_term_set_option(term, GF_OPT_DRAW_MODE, (gf_term_get_option(term, GF_OPT_DRAW_MODE)==GF_DRAW_MODE_DEFER) ? GF_DRAW_MODE_IMMEDIATE : GF_DRAW_MODE_DEFER );
-                       break;
-               case GF_KEY_4: 
-                       if (evt->key.flags & GF_KEY_MOD_CTRL)
-                               gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3); 
-                       break;
-               case GF_KEY_5: 
-                       if (evt->key.flags & GF_KEY_MOD_CTRL)
-                               gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9); 
-                       break;
-               case GF_KEY_6: 
-                       if (evt->key.flags & GF_KEY_MOD_CTRL)
-                               gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN); 
-                       break;
-               case GF_KEY_7: 
-                       if (evt->key.flags & GF_KEY_MOD_CTRL)
-                               gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP); 
-                       break;
-               case GF_KEY_P:
-                       if (evt->key.flags & GF_KEY_MOD_CTRL && is_connected) {
-                               Bool is_pause = gf_term_get_option(term, GF_OPT_PLAY_STATE);
-                               fprintf(stderr, "[Status: %s]\n", is_pause ? "Playing" : "Paused");
-                               gf_term_set_option(term, GF_OPT_PLAY_STATE, (gf_term_get_option(term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED) ? GF_STATE_PLAYING : GF_STATE_PAUSED);
-                       }
-                       break;
-               case GF_KEY_S:
-                       if ((evt->key.flags & GF_KEY_MOD_CTRL) && is_connected) {
-                               gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_STEP_PAUSE);
-                               fprintf(stderr, "Step time: ");
-                               PrintTime(gf_term_get_time_in_ms(term));
-                               fprintf(stderr, "\n");
-                       }
-                       break;
-               case GF_KEY_B:
-                       if ((evt->key.flags & GF_KEY_MOD_CTRL) && is_connected)
-                               ViewODs(term, 1);
-                       break;
-               case GF_KEY_M:
-                       if ((evt->key.flags & GF_KEY_MOD_CTRL) && is_connected)
-                               ViewODs(term, 0);
-                       break;
-               case GF_KEY_H:
-                       if ((evt->key.flags & GF_KEY_MOD_CTRL) && is_connected)
-                               gf_term_switch_quality(term, 1);
-                       break;
-               case GF_KEY_L:
-                       if ((evt->key.flags & GF_KEY_MOD_CTRL) && is_connected)
-                               gf_term_switch_quality(term, 0);
-                       break;
-               }
-               break;
-
-       case GF_EVENT_CONNECT:
-               if (evt->connect.is_connected) {
-                       is_connected = 1;
-                       fprintf(stderr, "Service Connected\n");
-               } else if (is_connected) {
-                       fprintf(stderr, "Service %s\n", is_connected ? "Disconnected" : "Connection Failed");
-                       is_connected = 0;
-                       Duration = 0;
-               }
-               if (init_w && init_h) {
-                       gf_term_set_size(term, init_w, init_h);
-               }
-               ResetCaption();
-               break;
-       case GF_EVENT_EOS:
-               restart = 1;
-               break;
-       case GF_EVENT_SIZE:
-               if (user.init_flags & GF_TERM_WINDOWLESS) {
-                       GF_Event move;
-                       move.type = GF_EVENT_MOVE;
-                       move.move.align_x = align_mode & 0xFF;
-                       move.move.align_y = (align_mode>>8) & 0xFF;
-                       move.move.relative = 2;
-                       gf_term_user_event(term, &move);
-               } 
-               break;
-       case GF_EVENT_SCENE_SIZE:
-               if (forced_width && forced_height) {
-                       GF_Event size;
-                       size.type = GF_EVENT_SIZE;
-                       size.size.width = forced_width;
-                       size.size.height = forced_height;
-                       gf_term_user_event(term, &size);
-               }
-               break;
-
-       case GF_EVENT_METADATA:
-               ResetCaption();
-               break;
-
-       case GF_EVENT_QUIT:
-               Run = 0;
-               break;
-       case GF_EVENT_DISCONNECT:
-               gf_term_disconnect(term);
-               break;
-       case GF_EVENT_MIGRATE:
-       {
-       }
-               break;
-       case GF_EVENT_NAVIGATE_INFO:
-               if (evt->navigate.to_url) fprintf(stderr, "Go to URL: \"%s\"\r", evt->navigate.to_url);
-               break;
-       case GF_EVENT_NAVIGATE:
-               if (gf_term_is_supported_url(term, evt->navigate.to_url, 1, no_mime_check)) {
-                       strcpy(the_url, evt->navigate.to_url);
-                       fprintf(stderr, "Navigating to URL %s\n", the_url);
-                       gf_term_navigate_to(term, evt->navigate.to_url);
-                       return 1;
-               } else {
-                       fprintf(stderr, "Navigation destination not supported\nGo to URL: %s\n", evt->navigate.to_url);
-               }
-               break;
-       case GF_EVENT_SET_CAPTION:
-               gf_term_user_event(term, evt);
-               break;
-       case GF_EVENT_AUTHORIZATION:
-               if (!strlen(evt->auth.user)) {
-                       fprintf(stderr, "Authorization required for site %s\n", evt->auth.site_url);
-                       fprintf(stderr, "login: ");
-                       scanf("%s", evt->auth.user);
-               } else {
-                       fprintf(stderr, "Authorization required for %s@%s\n", evt->auth.user, evt->auth.site_url);
-               }
-               fprintf(stderr, "password: ");
-               gf_prompt_set_echo_off(1);
-               scanf("%s", evt->auth.password);
-               gf_prompt_set_echo_off(0);
-               return 1;
-       case GF_EVENT_SYS_COLORS:
-#ifdef WIN32
-               evt->sys_cols.sys_colors[0] = get_sys_col(COLOR_ACTIVEBORDER);
-               evt->sys_cols.sys_colors[1] = get_sys_col(COLOR_ACTIVECAPTION);
-               evt->sys_cols.sys_colors[2] = get_sys_col(COLOR_APPWORKSPACE);
-               evt->sys_cols.sys_colors[3] = get_sys_col(COLOR_BACKGROUND);
-               evt->sys_cols.sys_colors[4] = get_sys_col(COLOR_BTNFACE);
-               evt->sys_cols.sys_colors[5] = get_sys_col(COLOR_BTNHIGHLIGHT);
-               evt->sys_cols.sys_colors[6] = get_sys_col(COLOR_BTNSHADOW);
-               evt->sys_cols.sys_colors[7] = get_sys_col(COLOR_BTNTEXT);
-               evt->sys_cols.sys_colors[8] = get_sys_col(COLOR_CAPTIONTEXT);
-               evt->sys_cols.sys_colors[9] = get_sys_col(COLOR_GRAYTEXT);
-               evt->sys_cols.sys_colors[10] = get_sys_col(COLOR_HIGHLIGHT);
-               evt->sys_cols.sys_colors[11] = get_sys_col(COLOR_HIGHLIGHTTEXT);
-               evt->sys_cols.sys_colors[12] = get_sys_col(COLOR_INACTIVEBORDER);
-               evt->sys_cols.sys_colors[13] = get_sys_col(COLOR_INACTIVECAPTION);
-               evt->sys_cols.sys_colors[14] = get_sys_col(COLOR_INACTIVECAPTIONTEXT);
-               evt->sys_cols.sys_colors[15] = get_sys_col(COLOR_INFOBK);
-               evt->sys_cols.sys_colors[16] = get_sys_col(COLOR_INFOTEXT);
-               evt->sys_cols.sys_colors[17] = get_sys_col(COLOR_MENU);
-               evt->sys_cols.sys_colors[18] = get_sys_col(COLOR_MENUTEXT);
-               evt->sys_cols.sys_colors[19] = get_sys_col(COLOR_SCROLLBAR);
-               evt->sys_cols.sys_colors[20] = get_sys_col(COLOR_3DDKSHADOW);
-               evt->sys_cols.sys_colors[21] = get_sys_col(COLOR_3DFACE);
-               evt->sys_cols.sys_colors[22] = get_sys_col(COLOR_3DHIGHLIGHT);
-               evt->sys_cols.sys_colors[23] = get_sys_col(COLOR_3DLIGHT);
-               evt->sys_cols.sys_colors[24] = get_sys_col(COLOR_3DSHADOW);
-               evt->sys_cols.sys_colors[25] = get_sys_col(COLOR_WINDOW);
-               evt->sys_cols.sys_colors[26] = get_sys_col(COLOR_WINDOWFRAME);
-               evt->sys_cols.sys_colors[27] = get_sys_col(COLOR_WINDOWTEXT);
-               return 1;
-#else
-               memset(evt->sys_cols.sys_colors, 0, sizeof(u32)*28);
-               return 1;
-#endif
-               break;
-       }
-       return 0;
-}
-
-
-void list_modules(GF_ModuleManager *modules)
-{
-       u32 i;
-       fprintf(stderr, "\rAvailable modules:\n");
-       for (i=0; i<gf_modules_get_count(modules); i++) {
-               char *str = (char *) gf_modules_get_file_name(modules, i);
-               if (str) fprintf(stderr, "\t%s\n", str);
-       }
-       fprintf(stderr, "\n");
-}
-
-
-void set_navigation()
-{
-       GF_Err e;
-       char navstr[20], nav;
-       u32 type = gf_term_get_option(term, GF_OPT_NAVIGATION_TYPE);
-       e = GF_OK;
-       if (!type) {
-               fprintf(stdout, "Content/compositor doesn't allow user-selectable navigation\n");
-       } else if (type==1) {
-               fprintf(stdout, "Select Navigation (\'N\'one, \'E\'xamine, \'S\'lide): ");
-               scanf("%s", navstr);
-               nav = navstr[0];
-               if (nav=='N') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_NONE);
-               else if (nav=='E') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_EXAMINE);
-               else if (nav=='S') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_SLIDE);
-               else fprintf(stdout, "Unknown selector \'%c\' - only \'N\',\'E\',\'S\' allowed\n", nav);
-       } else if (type==2) {
-               fprintf(stdout, "Select Navigation (\'N\'one, \'W\'alk, \'F\'ly, \'E\'xamine, \'P\'an, \'S\'lide, \'G\'ame, \'V\'R, \'O\'rbit): ");
-               scanf("%s", navstr);
-               nav = navstr[0];
-               if (nav=='N') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_NONE);
-               else if (nav=='W') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_WALK);
-               else if (nav=='F') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_FLY);
-               else if (nav=='E') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_EXAMINE);
-               else if (nav=='P') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_PAN);
-               else if (nav=='S') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_SLIDE);
-               else if (nav=='G') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_GAME);
-               else if (nav=='O') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_ORBIT);
-               else if (nav=='V') e = gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_VR);
-               else fprintf(stdout, "Unknown selector %c - only \'N\',\'W\',\'F\',\'E\',\'P\',\'S\',\'G\', \'V\', \'O\' allowed\n", nav);
-       }
-       if (e) fprintf(stdout, "Error setting mode: %s\n", gf_error_to_string(e));
-}
-
-
-static Bool get_time_list(char *arg, u32 *times, u32 *nb_times)
-{
-       char *str;
-       Float var;
-       Double sec;
-       u32 h, m, s, ms, f, fps;
-       if (!arg || (arg[0]=='-') || !isdigit(arg[0])) return 0;
-
-       /*SMPTE time code*/
-       if (strchr(arg, ':') && strchr(arg, ';') && strchr(arg, '/')) {
-               if (sscanf(arg, "%02d:%02d:%02d;%02d/%02d", &h, &m, &s, &f, &fps)==5) {
-                       sec = 0;
-                       if (fps) sec = ((Double)f) / fps;
-                       sec += 3600*h + 60*m + s;
-                       times[*nb_times] = (u32) (1000*sec);
-                       (*nb_times) ++;
-                       return 1;
-               }
-       }
-       while (arg) {
-               str = strchr(arg, '-');
-               if (str) str[0] = 0;
-               /*HH:MM:SS:MS time code*/
-               if (strchr(arg, ':') && (sscanf(arg, "%02d:%02d:%02d:%02d", &h, &m, &s, &ms)==4)) {
-                       sec = ms;
-                       sec /= 1000;
-                       sec += 3600*h + 60*m + s;
-                       times[*nb_times] = (u32) (1000*sec);
-                       (*nb_times) ++;
-               } else if (sscanf(arg, "%f", &var)==1) {
-                       sec = atof(arg);
-                       times[*nb_times] = (u32) (1000*sec);
-                       (*nb_times) ++;
-               }
-               if (!str) break;
-               str[0] = '-';
-               arg = str+1;
-       }
-       return 1;
-}
-
-static void on_gpac_log(void *cbk, u32 ll, u32 lm, const char *fmt, va_list list)
-{
-       FILE *logs = cbk;
-
-       if (rti_logs && (lm & GF_LOG_RTI)) {
-               char szMsg[2048];
-               vsprintf(szMsg, fmt, list);
-               UpdateRTInfo(szMsg + 6 /*"[RTI] "*/);
-       } else {
-               if (log_time_start) fprintf(logs, "[At %d]", gf_sys_clock() - log_time_start);
-               vfprintf(logs, fmt, list);
-               fflush(logs);
-       }
-}
-
-static void init_rti_logs(char *rti_file, char *url, Bool use_rtix)
-{
-       if (rti_logs) fclose(rti_logs);
-       rti_logs = gf_f64_open(rti_file, "wt");
-       if (rti_logs) {
-               fprintf(rti_logs, "!! GPAC RunTime Info ");
-               if (url) fprintf(rti_logs, "for file %s", url);
-               fprintf(rti_logs, " !!\n");
-               fprintf(rti_logs, "SysTime(ms)\tSceneTime(ms)\tCPU\tFPS\tMemory(kB)\tObservation\n");
-
-               /*turn on RTI loging*/
-               if (use_rtix) {
-                       gf_log_set_callback(NULL, on_gpac_log);
-                       gf_log_set_level(GF_LOG_DEBUG);
-                       gf_log_set_tools(GF_LOG_RTI);
-
-                       GF_LOG(GF_LOG_DEBUG, GF_LOG_RTI, ("[RTI] System state when enabling log\n"));
-               } else if (log_time_start) {
-                       log_time_start = gf_sys_clock();
-               }
-       }
-}
-
-#ifdef GPAC_IPHONE
-int SDL_main (int argc, char *argv[])
-#else
-int main (int argc, char *argv[])
-#endif
-{
-       char c;
-       const char *str;
-       u32 i, times[100], nb_times, dump_mode;
-       u32 simulation_time = 0;
-       Bool auto_exit = 0;
-       Bool logs_set = 0;
-       Bool start_fs = 0;
-       Bool use_rtix = 0;
-       Bool rgbds_dump = 0;
-       Bool rgbd_dump = 0;
-       Bool depth_dump = 0;
-       Bool pause_at_first = 0;
-       Bool enable_mem_tracker = 0;
-       Double fps = 25.0;
-       Bool ret, fill_ar, visible;
-       char *url_arg, *the_cfg, *rti_file;
-       GF_SystemRTInfo rti;
-       FILE *playlist = NULL;
-       FILE *logfile = NULL;
-       Float scale = 1;
-       int *libgpac_so = NULL;
-       
-       libgpac_so = dlopen("/Applications/osmo4ios.app/libgpac_dynamic.dylib", RTLD_LAZY);
-       fprintf(stderr, "dlopen libgpac_so: %p\n", libgpac_so);
-       fprintf(stderr, "dlsym: %p gf_log_lt\n", gf_log_lt = dlsym(libgpac_so, "gf_log_lt"));
-       fprintf(stderr, "dlsym: %p AVI_close\n", AVI_close = dlsym(libgpac_so, "AVI_close"));
-       fprintf(stderr, "dlsym: %p gf_sleep\n", gf_sleep = dlsym(libgpac_so, "gf_sleep"));
-       fprintf(stderr, "dlsym: %p gf_term_del\n", gf_term_del = dlsym(libgpac_so, "gf_term_del"));
-       fprintf(stderr, "dlsym: %p gf_sc_release_screen_buffer\n", gf_sc_release_screen_buffer = dlsym(libgpac_so, "gf_sc_release_screen_buffer"));
-       fprintf(stderr, "dlsym: %p gf_prompt_get_char\n", gf_prompt_get_char = dlsym(libgpac_so, "gf_prompt_get_char"));
-       fprintf(stderr, "dlsym: %p gf_set_progress\n", gf_set_progress = dlsym(libgpac_so, "gf_set_progress"));
-       fprintf(stderr, "dlsym: %p gf_term_new\n", gf_term_new = dlsym(libgpac_so, "gf_term_new"));
-       fprintf(stderr, "dlsym: %p gf_term_process_step\n", gf_term_process_step = dlsym(libgpac_so, "gf_term_process_step"));
-       fprintf(stderr, "dlsym: %p gf_sc_get_screen_buffer\n", gf_sc_get_screen_buffer = dlsym(libgpac_so, "gf_sc_get_screen_buffer"));
-       fprintf(stderr, "dlsym: %p gf_iphone_set_sdl_audio_module\n", gf_iphone_set_sdl_audio_module = dlsym(libgpac_so, "gf_iphone_set_sdl_audio_module"));
-       fprintf(stderr, "dlsym: %p gf_term_step_clocks\n", gf_term_step_clocks = dlsym(libgpac_so, "gf_term_step_clocks"));
-       fprintf(stderr, "dlsym: %p gf_prompt_set_echo_off\n", gf_prompt_set_echo_off = dlsym(libgpac_so, "gf_prompt_set_echo_off"));
-       fprintf(stderr, "dlsym: %p gf_log_get_tools\n", gf_log_get_tools = dlsym(libgpac_so, "gf_log_get_tools"));
-       fprintf(stderr, "dlsym: %p gf_log_get_level\n", gf_log_get_level = dlsym(libgpac_so, "gf_log_get_level"));
-       fprintf(stderr, "dlsym: %p gf_cfg_set_key\n", gf_cfg_set_key = dlsym(libgpac_so, "gf_cfg_set_key"));
-       fprintf(stderr, "dlsym: %p gf_cfg_get_section_count\n", gf_cfg_get_section_count = dlsym(libgpac_so, "gf_cfg_get_section_count"));
-       fprintf(stderr, "dlsym: %p gf_term_get_service_info\n", gf_term_get_service_info = dlsym(libgpac_so, "gf_term_get_service_info"));
-       fprintf(stderr, "dlsym: %p gf_term_set_size\n", gf_term_set_size = dlsym(libgpac_so, "gf_term_set_size"));
-       fprintf(stderr, "dlsym: %p gf_sys_get_rti\n", gf_sys_get_rti = dlsym(libgpac_so, "gf_sys_get_rti"));
-       fprintf(stderr, "dlsym: %p gf_log_set_tools\n", gf_log_set_tools = dlsym(libgpac_so, "gf_log_set_tools"));
-       fprintf(stderr, "dlsym: %p gf_term_play_from_time\n", gf_term_play_from_time = dlsym(libgpac_so, "gf_term_play_from_time"));
-       fprintf(stderr, "dlsym: %p gf_malloc\n", gf_malloc = dlsym(libgpac_so, "gf_malloc"));
-       fprintf(stderr, "dlsym: %p gf_log_set_level\n", gf_log_set_level = dlsym(libgpac_so, "gf_log_set_level"));
-       fprintf(stderr, "dlsym: %p gf_iphone_set_sdl_video_module\n", gf_iphone_set_sdl_video_module = dlsym(libgpac_so, "gf_iphone_set_sdl_video_module"));
-       fprintf(stderr, "dlsym: %p gf_term_get_option\n", gf_term_get_option = dlsym(libgpac_so, "gf_term_get_option"));
-       fprintf(stderr, "dlsym: %p gf_term_user_event\n", gf_term_user_event = dlsym(libgpac_so, "gf_term_user_event"));
-       fprintf(stderr, "dlsym: %p gf_modules_get_file_name\n", gf_modules_get_file_name = dlsym(libgpac_so, "gf_modules_get_file_name"));
-       fprintf(stderr, "dlsym: %p gf_mx_new\n", gf_mx_new = dlsym(libgpac_so, "gf_mx_new"));
-       fprintf(stderr, "dlsym: %p gf_list_count\n", gf_list_count = dlsym(libgpac_so, "gf_list_count"));
-       fprintf(stderr, "dlsym: %p gf_free\n", gf_free = dlsym(libgpac_so, "gf_free"));
-       fprintf(stderr, "dlsym: %p gf_term_get_world_info\n", gf_term_get_world_info = dlsym(libgpac_so, "gf_term_get_world_info"));
-       fprintf(stderr, "dlsym: %p gf_cfg_get_section_name\n", gf_cfg_get_section_name = dlsym(libgpac_so, "gf_cfg_get_section_name"));
-       fprintf(stderr, "dlsym: %p gf_term_navigate_to\n", gf_term_navigate_to = dlsym(libgpac_so, "gf_term_navigate_to"));
-       fprintf(stderr, "dlsym: %p gf_modules_del\n", gf_modules_del = dlsym(libgpac_so, "gf_modules_del"));
-       fprintf(stderr, "dlsym: %p gf_modules_new\n", gf_modules_new = dlsym(libgpac_so, "gf_modules_new"));
-       fprintf(stderr, "dlsym: %p gf_sys_init\n", gf_sys_init = dlsym(libgpac_so, "gf_sys_init"));
-       fprintf(stderr, "dlsym: %p gf_log\n", gf_log = dlsym(libgpac_so, "gf_log"));
-       fprintf(stderr, "dlsym: %p gf_term_get_object_info\n", gf_term_get_object_info = dlsym(libgpac_so, "gf_term_get_object_info"));
-       fprintf(stderr, "dlsym: %p gf_mx_p\n", gf_mx_p = dlsym(libgpac_so, "gf_mx_p"));
-       fprintf(stderr, "dlsym: %p gf_mx_v\n", gf_mx_v = dlsym(libgpac_so, "gf_mx_v"));
-       fprintf(stderr, "dlsym: %p gf_mx_del\n", gf_mx_del = dlsym(libgpac_so, "gf_mx_del"));
-       fprintf(stderr, "dlsym: %p gf_term_process_flush\n", gf_term_process_flush = dlsym(libgpac_so, "gf_term_process_flush"));
-       fprintf(stderr, "dlsym: %p gf_cfg_get_key_name\n", gf_cfg_get_key_name = dlsym(libgpac_so, "gf_cfg_get_key_name"));
-       fprintf(stderr, "dlsym: %p AVI_write_frame\n", AVI_write_frame = dlsym(libgpac_so, "AVI_write_frame"));
-       fprintf(stderr, "dlsym: %p gf_cfg_del\n", gf_cfg_del = dlsym(libgpac_so, "gf_cfg_del"));
-       fprintf(stderr, "dlsym: %p gf_term_get_channel_net_info\n", gf_term_get_channel_net_info = dlsym(libgpac_so, "gf_term_get_channel_net_info"));
-       fprintf(stderr, "dlsym: %p gf_term_process_shortcut\n", gf_term_process_shortcut = dlsym(libgpac_so, "gf_term_process_shortcut"));
-       fprintf(stderr, "dlsym: %p gf_cfg_init\n", gf_cfg_init = dlsym(libgpac_so, "gf_cfg_init"));
-       fprintf(stderr, "dlsym: %p gf_term_get_download_info\n", gf_term_get_download_info = dlsym(libgpac_so, "gf_term_get_download_info"));
-       fprintf(stderr, "dlsym: %p gf_sys_clock\n", gf_sys_clock = dlsym(libgpac_so, "gf_sys_clock"));
-       fprintf(stderr, "dlsym: %p gf_term_get_object\n", gf_term_get_object = dlsym(libgpac_so, "gf_term_get_object"));
-       fprintf(stderr, "dlsym: %p gf_term_set_option\n", gf_term_set_option = dlsym(libgpac_so, "gf_term_set_option"));
-       fprintf(stderr, "dlsym: %p gf_sys_close\n", gf_sys_close = dlsym(libgpac_so, "gf_sys_close"));
-       fprintf(stderr, "dlsym: %p gf_term_connect_from_time\n", gf_term_connect_from_time = dlsym(libgpac_so, "gf_term_connect_from_time"));
-       fprintf(stderr, "dlsym: %p AVI_open_output_file\n", AVI_open_output_file = dlsym(libgpac_so, "AVI_open_output_file"));
-       fprintf(stderr, "dlsym: %p gf_cfg_get_key\n", gf_cfg_get_key = dlsym(libgpac_so, "gf_cfg_get_key"));
-       fprintf(stderr, "dlsym: %p AVI_set_video\n", AVI_set_video = dlsym(libgpac_so, "AVI_set_video"));
-       fprintf(stderr, "dlsym: %p gf_term_set_speed\n", gf_term_set_speed = dlsym(libgpac_so, "gf_term_set_speed"));
-       fprintf(stderr, "dlsym: %p gf_cfg_get_key_count\n", gf_cfg_get_key_count = dlsym(libgpac_so, "gf_cfg_get_key_count"));
-       fprintf(stderr, "dlsym: %p gf_term_object_subscene_type\n", gf_term_object_subscene_type = dlsym(libgpac_so, "gf_term_object_subscene_type"));
-       fprintf(stderr, "dlsym: %p gf_term_get_framerate\n", gf_term_get_framerate = dlsym(libgpac_so, "gf_term_get_framerate"));
-       fprintf(stderr, "dlsym: %p gf_error_to_string\n", gf_error_to_string = dlsym(libgpac_so, "gf_error_to_string"));
-       fprintf(stderr, "dlsym: %p gf_stretch_bits\n", gf_stretch_bits = dlsym(libgpac_so, "gf_stretch_bits"));
-       fprintf(stderr, "dlsym: %p gf_list_del\n", gf_list_del = dlsym(libgpac_so, "gf_list_del"));
-       fprintf(stderr, "dlsym: %p gf_list_get\n", gf_list_get = dlsym(libgpac_so, "gf_list_get"));
-       fprintf(stderr, "dlsym: %p gf_term_disconnect\n", gf_term_disconnect = dlsym(libgpac_so, "gf_term_disconnect"));
-       fprintf(stderr, "dlsym: %p gf_term_is_supported_url\n", gf_term_is_supported_url = dlsym(libgpac_so, "gf_term_is_supported_url"));
-       fprintf(stderr, "dlsym: %p gf_list_new\n", gf_list_new = dlsym(libgpac_so, "gf_list_new"));
-       fprintf(stderr, "dlsym: %p gf_modules_get_option\n", gf_modules_get_option = dlsym(libgpac_so, "gf_modules_get_option"));
-       fprintf(stderr, "dlsym: %p gf_term_dump_scene\n", gf_term_dump_scene = dlsym(libgpac_so, "gf_term_dump_scene"));
-       fprintf(stderr, "dlsym: %p gf_prompt_has_input\n", gf_prompt_has_input = dlsym(libgpac_so, "gf_prompt_has_input"));
-       fprintf(stderr, "dlsym: %p gf_term_scene_update\n", gf_term_scene_update = dlsym(libgpac_so, "gf_term_scene_update"));
-       fprintf(stderr, "dlsym: %p gf_term_connect\n", gf_term_connect = dlsym(libgpac_so, "gf_term_connect"));
-       fprintf(stderr, "dlsym: %p gf_term_get_object_count\n", gf_term_get_object_count = dlsym(libgpac_so, "gf_term_get_object_count"));
-       fprintf(stderr, "dlsym: %p gf_modules_get_count\n", gf_modules_get_count = dlsym(libgpac_so, "gf_modules_get_count"));
-       fprintf(stderr, "dlsym: %p gf_term_get_root_object\n", gf_term_get_root_object = dlsym(libgpac_so, "gf_term_get_root_object"));
-       fprintf(stderr, "dlsym: %p gf_term_get_time_in_ms\n", gf_term_get_time_in_ms = dlsym(libgpac_so, "gf_term_get_time_in_ms"));
-       fprintf(stderr, "dlsym: %p gf_term_connect_with_path\n", gf_term_connect_with_path = dlsym(libgpac_so, "gf_term_connect_with_path"));
-       fprintf(stderr, "dlsym: %p gf_log_set_callback\n", gf_log_set_callback = dlsym(libgpac_so, "gf_log_set_callback"));
-       fprintf(stderr, "dlsym: %p gf_log_parse_tools\n", gf_log_parse_tools = dlsym(libgpac_so, "gf_log_parse_tools"));
-       fprintf(stderr, "dlsym: %p gf_log_parse_level\n", gf_log_parse_level = dlsym(libgpac_so, "gf_log_parse_level"));
-       fprintf(stderr, "dlsym: %p gf_term_switch_quality\n", gf_term_switch_quality = dlsym(libgpac_so, "gf_term_switch_quality"));
-       fprintf(stderr, "dlsym: %p gf_term_release_screen_buffer\n", gf_term_release_screen_buffer = dlsym(libgpac_so, "gf_term_release_screen_buffer"));
-       fprintf(stderr, "dlsym: %p gf_term_get_screen_buffer\n", gf_term_get_screen_buffer = dlsym(libgpac_so, "gf_term_get_screen_buffer"));
-       fprintf(stderr, "dlsym: %p gf_f64_open\n", gf_f64_open = dlsym(libgpac_so, "gf_f64_open"));
-       fprintf(stderr, "dlsym: %p gf_img_png_enc\n", gf_img_png_enc = dlsym(libgpac_so, "gf_img_png_enc"));
-       fprintf(stderr, "dlsym: %p utf8_to_ucs4\n", utf8_to_ucs4 = dlsym(libgpac_so, "utf8_to_ucs4"));
-
-       /*by default use current dir*/
-       strcpy(the_url, ".");
-
-       memset(&user, 0, sizeof(GF_User));
-
-       dump_mode = 0;
-       fill_ar = visible = 0;
-       url_arg = the_cfg = rti_file = NULL;
-       nb_times = 0;
-       times[0] = 0;
-
-       /*first locate config file if specified*/
-       for (i=1; i<(u32) argc; i++) {
-               char *arg = argv[i];
-               if (!strcmp(arg, "-c") || !strcmp(arg, "-cfg")) {
-                       the_cfg = argv[i+1];
-                       i++;
-               }
-               else if (!strcmp(arg, "-mem-track")) enable_mem_tracker = 1;
-       }
-
-       gf_sys_init(enable_mem_tracker);
-       gf_iphone_set_sdl_video_module(SDL_NewVideo);
-       gf_iphone_set_sdl_audio_module(SDL_NewAudio);
-       
-       cfg_file = gf_cfg_init(the_cfg, NULL);
-       if (!cfg_file) {
-               fprintf(stdout, "Error: Configuration File \"GPAC.cfg\" not found\n");
-               if (logfile) fclose(logfile);
-               return 1;
-       }
-
-{
-       logs_set = 1;
-       
-       gf_log_set_level( gf_log_parse_level( gf_cfg_get_key(cfg_file, "General", "LogLevel") ) );
-       gf_log_set_tools( gf_log_parse_tools( gf_cfg_get_key(cfg_file, "General", "LogTools") ) );
-}
-
-       for (i=1; i<(u32) argc; i++) {
-               char *arg = argv[i];
-//             if (isalnum(arg[0]) || (arg[0]=='/') || (arg[0]=='.') || (arg[0]=='\\') ) {
-               if (arg[0] != '-') {
-                       url_arg = arg;
-               } else if (!strcmp(arg, "-c") || !strcmp(arg, "-cfg")) {
-                       the_cfg = argv[i+1];
-                       i++;
-               } else if (!strcmp(arg, "-rti")) {
-                       rti_file = argv[i+1];
-                       i++;
-               } else if (!strcmp(arg, "-rtix")) {
-                       rti_file = argv[i+1];
-                       i++;
-                       use_rtix = 1;
-               } else if (!strcmp(arg, "-fill")) {
-                       fill_ar = 1;
-               } else if (!strcmp(arg, "-show")) {
-                       visible = 1;
-               } else if (!strcmp(arg, "-avi")) {
-                       if (rgbds_dump) dump_mode = 5;
-                       else if (depth_dump) dump_mode = 8;
-                       else if (rgbd_dump) dump_mode = 10;
-                       else dump_mode=1;
-                       if ((url_arg || (i+2<(u32)argc)) && get_time_list(argv[i+1], times, &nb_times)) i++;
-               } else if (!strcmp(arg, "-rgbds")) { /*get dump in rgbds pixel format*/
-                       rgbds_dump = 1;
-                       dump_mode=6;                    /* rgbds texture directly*/
-                       if (dump_mode==1) dump_mode = 5;    /* .avi rgbds dump*/
-               } else if (!strcmp(arg, "-rgbd")) { /*get dump in rgbd pixel format*/
-                       rgbd_dump = 1;
-                       dump_mode=9;  /* rgbd texture directly*/
-                       if (dump_mode==1) dump_mode = 10;    /* .avi rgbds dump*/
-               } else if (!strcmp(arg, "-depth")) {
-                       depth_dump = 1;        
-                       if (dump_mode==2) dump_mode=7; /* grayscale .bmp depth dump*/
-                       else if (dump_mode==1) dump_mode=8; /* .avi depth dump*/
-                       else dump_mode=4;   /*depth dump*/
-               } else if (!strcmp(arg, "-bmp")) {
-                       if(depth_dump) dump_mode=7; /*grayscale depth .bmp dump*/
-                       else dump_mode=2;
-                       if ((url_arg || (i+2<(u32)argc)) && get_time_list(argv[i+1], times, &nb_times)) i++;
-               } else if (!strcmp(arg, "-raw")) {
-                       dump_mode = 3;
-                       if ((url_arg || (i+2<(u32)argc)) && get_time_list(argv[i+1], times, &nb_times)) i++;
-
-               } else if (!stricmp(arg, "-size")) {
-                       if (sscanf(argv[i+1], "%dx%d", &forced_width, &forced_height) != 2) {
-                               forced_width = forced_height = 0;
-                       }
-                       i++;
-               } else if (!stricmp(arg, "-scale")) {
-                       sscanf(argv[i+1], "%f", &scale);
-                       i++;
-               } else if (!stricmp(arg, "-fps")) {
-                       fps = atof(argv[i+1]);
-                       i++;
-               } else if (!strcmp(arg, "-quiet")) {
-                       be_quiet = 1;
-               } else if (!strcmp(arg, "-log-file") || !strcmp(arg, "-lf")) {
-                       logfile = gf_f64_open(argv[i+1], "wt");
-                       gf_log_set_callback(logfile, on_gpac_log);
-                       i++;
-               } else if (!strcmp(arg, "-log-level") || !strcmp(arg, "-ll")) {
-                       gf_log_set_level(gf_log_parse_level(argv[i+1]));
-                       logs_set = 1;
-                       i++;
-               } else if (!strcmp(arg, "-log-tools") || !strcmp(arg, "-lt")) {
-                       gf_log_set_tools(gf_log_parse_tools(argv[i+1]));
-                       logs_set = 1;
-                       i++;
-               } else if (!strcmp(arg, "-log-clock") || !strcmp(arg, "-lc")) {
-                       log_time_start = 1;
-               } else if (!strcmp(arg, "-align")) {
-                       if (argv[i+1][0]=='m') align_mode = 1;
-                       else if (argv[i+1][0]=='b') align_mode = 2;
-                       align_mode <<= 8;
-                       if (argv[i+1][1]=='m') align_mode |= 1;
-                       else if (argv[i+1][1]=='r') align_mode |= 2;
-                       i++;
-               }
-               else if (!strcmp(arg, "-no-wnd")) user.init_flags |= GF_TERM_WINDOWLESS;
-#if defined(__DARWIN__) || defined(__APPLE__)
-               else if (!strcmp(arg, "-thread")) not_threaded = 0;
-#else
-               else if (!strcmp(arg, "-no-thread")) not_threaded = 1;
-#endif
-               else if (!strcmp(arg, "-no-audio")) no_audio = 1;
-               else if (!strcmp(arg, "-no-regulation")) no_regulation = 1;
-               else if (!strcmp(arg, "-fs")) start_fs = 1;
-               else if (!strcmp(arg, "-pause")) pause_at_first = 1;
-               else if (!strcmp(arg, "-exit")) auto_exit = 1;
-               else if (!strcmp(arg, "-mem-track")) enable_mem_tracker = 1;
-               else if (!strcmp(arg, "-opt")) {
-                       char *sep, *sep2, szSec[1024], szKey[1024], szVal[1024];
-                       sep = strchr(argv[i+1], ':');
-                       if (sep) {
-                               sep[0] = 0;
-                               strcpy(szSec, argv[i+1]);
-                               sep[0] = ':'; sep ++;
-                               sep2 = strchr(sep, '=');
-                               if (sep2) {
-                                       sep2[0] = 0;
-                                       strcpy(szKey, sep);
-                                       strcpy(szVal, sep2+1);
-                                       sep2[0] = '='; 
-                                       if (!stricmp(szVal, "null")) szVal[0]=0;
-                                       gf_cfg_set_key(cfg_file, szSec, szKey, szVal[0] ? szVal : NULL);
-                               }
-                       }
-                       i++;
-               }
-               else if (!strncmp(arg, "-run-for=", 9)) simulation_time = atoi(arg+9);
-               else {
-                       PrintUsage();
-                       return 1;
-               }
-       }
-       if (dump_mode && !url_arg) {
-               fprintf(stdout, "Missing argument for dump\n");
-               PrintUsage();
-               if (logfile) fclose(logfile);
-               return 1;
-       }
-       if (dump_mode) rti_file = NULL;
-
-       if (!logs_set) {
-               gf_log_set_level(GF_LOG_ERROR);
-               gf_log_set_tools(0xFFFFFFFF);
-       }
-
-       gf_sys_get_rti(500, &rti, GF_RTI_SYSTEM_MEMORY_ONLY);
-       memory_at_gpac_startup = rti.physical_memory_avail;
-       if (rti_file) init_rti_logs(rti_file, url_arg, use_rtix);
-
-       /*setup dumping options*/
-       if (dump_mode) {
-               user.init_flags |= GF_TERM_NO_AUDIO | GF_TERM_NO_COMPOSITOR_THREAD | GF_TERM_NO_REGULATION /*| GF_TERM_INIT_HIDE*/;
-               if (visible || dump_mode==8) user.init_flags |= GF_TERM_INIT_HIDE;
-       } else {
-               init_w = forced_width;
-               init_h = forced_height;
-       }
-
-       fprintf(stderr, "Loading modules\n");
-       str = gf_cfg_get_key(cfg_file, "General", "ModulesDirectory");
-
-       user.modules = gf_modules_new((const unsigned char *) str, cfg_file);
-       if (user.modules) i = gf_modules_get_count(user.modules);
-       if (!i || !user.modules) {
-               fprintf(stdout, "Error: no modules found in %s - exiting\n", str);
-               if (user.modules) gf_modules_del(user.modules);
-               gf_cfg_del(cfg_file);
-               gf_sys_close();
-               if (logfile) fclose(logfile);
-               return 1;
-       }
-       fprintf(stderr, "Modules Loaded (%d found in %s)\n", i, str);
-       
-       user.config = cfg_file;
-       user.EventProc = GPAC_EventProc;
-       /*dummy in this case (global vars) but MUST be non-NULL*/
-       user.opaque = user.modules;
-       if (not_threaded) user.init_flags |= GF_TERM_NO_COMPOSITOR_THREAD;
-       if (no_audio) user.init_flags |= GF_TERM_NO_AUDIO;
-       if (no_regulation) user.init_flags |= GF_TERM_NO_REGULATION;
-
-       fprintf(stderr, "Loading GPAC Terminal\n");     
-       term = gf_term_new(&user);
-       if (!term) {
-               fprintf(stderr, "\nInit error - check you have at least one video out and one rasterizer...\nFound modules:\n");
-               list_modules(user.modules);
-               gf_modules_del(user.modules);
-               gf_cfg_del(cfg_file);
-               gf_sys_close();
-               if (logfile) fclose(logfile);
-               return 1;
-       }
-       fprintf(stderr, "Terminal Loaded\n");
-
-
-       if (dump_mode) {
-//             gf_term_set_option(term, GF_OPT_VISIBLE, 0);
-               if (fill_ar) gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN);
-       } else {
-               /*check video output*/
-               str = gf_cfg_get_key(cfg_file, "Video", "DriverName");
-               if (!strcmp(str, "Raw Video Output")) fprintf(stdout, "WARNING: using raw output video (memory only) - no display used\n");
-               /*check audio output*/
-               str = gf_cfg_get_key(cfg_file, "Audio", "DriverName");
-               if (!str || !strcmp(str, "No Audio Output Available")) fprintf(stdout, "WARNING: no audio output availble - make sure no other program is locking the sound card\n");
-
-               str = gf_cfg_get_key(cfg_file, "General", "NoMIMETypeFetch");
-               no_mime_check = (str && !stricmp(str, "yes")) ? 1 : 0;
-       }
-
-       str = gf_cfg_get_key(cfg_file, "HTTPProxy", "Enabled");
-       if (str && !strcmp(str, "yes")) {
-               str = gf_cfg_get_key(cfg_file, "HTTPProxy", "Name");
-               if (str) fprintf(stdout, "HTTP Proxy %s enabled\n", str);
-       }
-
-       if (rti_file) {
-               str = gf_cfg_get_key(cfg_file, "General", "RTIRefreshPeriod");
-               if (str) {
-                       rti_update_time_ms = atoi(str);
-               } else {
-                       gf_cfg_set_key(cfg_file, "General", "RTIRefreshPeriod", "200");
-               }
-               UpdateRTInfo("At GPAC load time\n");
-       }
-
-       Run = 1;
-       ret = 1;
-
-       if (dump_mode) {
-               if (!nb_times) {
-                       times[0] = 0;
-                       nb_times++;
-               }
-               ret = dump_file(url_arg, dump_mode, fps, forced_width, forced_height, scale, times, nb_times);
-               Run = 0;
-       } else
-
-       /*connect if requested*/
-       if (url_arg) {
-               char *ext;
-               strcpy(the_url, url_arg);
-               ext = strrchr(the_url, '.');
-               if (ext && (!stricmp(ext, ".m3u") || !stricmp(ext, ".pls"))) {
-                       fprintf(stdout, "Opening Playlist %s\n", the_url);
-                       playlist = gf_f64_open(the_url, "rt");
-                       if (playlist) {
-                               strcpy(pl_path, the_url);
-                               fscanf(playlist, "%s", the_url);
-                               fprintf(stdout, "Opening URL %s\n", the_url);
-                               gf_term_connect_with_path(term, the_url, pl_path);
-                       } else {
-                               fprintf(stdout, "Hit 'h' for help\n\n");
-                       }
-               } else {
-                       fprintf(stdout, "Opening URL %s\n", the_url);
-                       if (pause_at_first) fprintf(stdout, "[Status: Paused]\n");
-                       gf_term_connect_from_time(term, the_url, 0, pause_at_first);
-               }
-       } else {
-               fprintf(stdout, "Hit 'h' for help\n\n");
-               str = gf_cfg_get_key(cfg_file, "General", "StartupFile");
-               if (str) {
-                       strcpy(the_url, "MP4Client "GPAC_FULL_VERSION);
-                       gf_term_connect(term, str);
-                       startup_file = 1;
-               }
-       }
-       /*force fullscreen*/
-       if (start_fs) 
-               gf_term_set_option(term, GF_OPT_FULLSCREEN, 1);
-
-       while (Run) {
-               /*we don't want getchar to block*/
-               if (1 || !gf_prompt_has_input()) {
-                       if (restart) {
-                               restart = 0;
-                               gf_term_play_from_time(term, 0, 0);
-                       }
-                       if (request_next_playlist_item) {
-                               c = '\n';
-                               request_next_playlist_item = 0;
-                               goto force_input;
-                       }
-                       if (!use_rtix || display_rti) UpdateRTInfo(NULL);
-                       if (not_threaded) {
-                               //printf("gf_term_process_step from run loop\n");
-                               gf_term_process_step(term);
-                               if (auto_exit && gf_term_get_option(term, GF_OPT_IS_OVER)) {
-                                       Run = 0;
-                               } 
-                       } else {
-                               gf_sleep(rti_update_time_ms);
-                       }
-                       /*sim time*/
-                       if (simulation_time && (gf_term_get_time_in_ms(term)>simulation_time)) {
-                               Run = 0;
-                       }
-                       continue;
-               }
-               c = gf_prompt_get_char();
-
-force_input:
-               switch (c) {
-               case 'q':
-                       Run = 0;
-                       break;
-               case 'X':
-                       exit(0);
-                       break;
-               case 'Q':
-                       break;
-               case 'o':
-                       startup_file = 0;
-                       gf_term_disconnect(term);
-                       fprintf(stdout, "Enter the absolute URL\n");
-                       scanf("%s", the_url);
-                       if (rti_file) init_rti_logs(rti_file, the_url, use_rtix);
-                       gf_term_connect(term, the_url);
-                       break;
-               case 'O':
-                       gf_term_disconnect(term);
-                       fprintf(stdout, "Enter the absolute URL to the playlist\n");
-                       scanf("%s", the_url);
-                       playlist = gf_f64_open(the_url, "rt");
-                       if (playlist) {
-                               fscanf(playlist, "%s", the_url);
-                               fprintf(stdout, "Opening URL %s\n", the_url);
-                               gf_term_connect(term, the_url);
-                       }
-                       break;
-               case '\n':
-               case 'N':
-                       if (playlist) {
-                               gf_term_disconnect(term);
-
-                               if (fscanf(playlist, "%s", the_url) == EOF) {
-                                       fprintf(stdout, "No more items - exiting\n");
-                                       Run = 0;
-                               } else {
-                                       fprintf(stdout, "Opening URL %s\n", the_url);
-                                       gf_term_connect_with_path(term, the_url, pl_path);
-                               }
-                       }
-                       break;
-               case 'P':
-                       if (playlist) {
-                               u32 count;
-                               gf_term_disconnect(term);
-                               scanf("%d", &count);
-                               while (count) {
-                                       fscanf(playlist, "%s", the_url);
-                                       count--;
-                               }
-                               fprintf(stdout, "Opening URL %s\n", the_url);
-                               gf_term_connect(term, the_url);
-                       }
-                       break;
-               case 'r':
-                       if (is_connected) {
-                               gf_term_disconnect(term);
-                               gf_term_connect(term, startup_file ? gf_cfg_get_key(cfg_file, "General", "StartupFile") : the_url);
-                       }
-                       break;
-               
-               case 'D':
-                       if (is_connected) gf_term_disconnect(term);
-                       break;
-
-               case 'p':
-                       if (is_connected) {
-                               Bool is_pause = gf_term_get_option(term, GF_OPT_PLAY_STATE);
-                               fprintf(stdout, "[Status: %s]\n", is_pause ? "Playing" : "Paused");
-                               gf_term_set_option(term, GF_OPT_PLAY_STATE, is_pause ? GF_STATE_PLAYING : GF_STATE_PAUSED);
-                       }
-                       break;
-               case 's':
-                       if (is_connected) {
-                               gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_STEP_PAUSE);
-                               fprintf(stdout, "Step time: ");
-                               PrintTime(gf_term_get_time_in_ms(term));
-                               fprintf(stdout, "\n");
-                       }
-                       break;
-
-               case 'z':
-                       if (!CanSeek || (Duration<=2000)) {
-                               fprintf(stdout, "scene not seekable\n");
-                       } else {
-                               Double res;
-                               s32 seekTo;
-                               fprintf(stdout, "Duration: ");
-                               PrintTime(Duration);
-                               res = gf_term_get_time_in_ms(term);
-                               res *= 100; res /= (s64)Duration;
-                               fprintf(stdout, " (current %.2f %%)\nEnter Seek percentage:\n", res);
-                               if (scanf("%d", &seekTo) == 1) { 
-                                       if (seekTo > 100) seekTo = 100;
-                                       res = (Double)(s64)Duration; res /= 100; res *= seekTo;
-                                       gf_term_play_from_time(term, (u64) (s64) res, 0);
-                               }
-                       }
-                       break;
-
-               case 't':
-               {
-                       if (is_connected) {
-                               fprintf(stdout, "Current Time: ");
-                               PrintTime(gf_term_get_time_in_ms(term));
-                               fprintf(stdout, " - Duration: ");
-                               PrintTime(Duration);
-                               fprintf(stdout, "\n");
-                       }
-               }
-                       break;
-               case 'w':
-                       if (is_connected) PrintWorldInfo(term);
-                       break;
-               case 'v':
-                       if (is_connected) PrintODList(term, NULL, 0, 0, "Root");
-                       break;
-               case 'i':
-                       if (is_connected) {
-                               u32 ID;
-                               fprintf(stdout, "Enter OD ID (0 for main OD): ");
-                               fflush(stdout);
-                               scanf("%d", &ID);
-                               ViewOD(term, ID, (u32)-1);
-                       }
-                       break;
-               case 'j':
-                       if (is_connected) {
-                               u32 num;
-                               fprintf(stdout, "Enter OD number (0 for main OD): ");
-                               fflush(stdout);
-                               scanf("%d", &num);
-                               ViewOD(term, (u32)-1, num);
-                       }
-                       break;
-               case 'b':
-                       if (is_connected) ViewODs(term, 1);
-                       break;
-
-               case 'm':
-                       if (is_connected) ViewODs(term, 0);
-                       break;
-
-               case 'l':
-                       list_modules(user.modules);
-                       break;
-
-               case 'n':
-                       if (is_connected) set_navigation();
-                       break;
-               case 'x':
-                       if (is_connected) gf_term_set_option(term, GF_OPT_NAVIGATION_TYPE, 0);
-                       break;
-
-               case 'd':
-                       if (is_connected) {
-                               GF_ObjectManager *odm = NULL;
-                               char radname[GF_MAX_PATH], *sExt;
-                               GF_Err e;
-                               u32 i, count, odid;
-                               Bool xml_dump, std_out;
-                               fprintf(stdout, "Enter Inline OD ID if any or 0");
-                               fflush(stdout);
-                               radname[0] = 0;
-                               scanf("%d", &odid);
-                               if (odid) {
-                                       GF_ObjectManager *root_odm = gf_term_get_root_object(term);
-                                       if (!root_odm) break;
-                                       count = gf_term_get_object_count(term, root_odm);
-                                       for (i=0; i<count; i++) {
-                                               GF_MediaInfo info;
-                                               odm = gf_term_get_object(term, root_odm, i);
-                                               if (gf_term_get_object_info(term, odm, &info) == GF_OK) {
-                                                       if (info.od->objectDescriptorID==odid) break;
-                                               }
-                                               odm = NULL;
-                                       }
-                               }
-                               fprintf(stdout, "Enter file radical name (+\'.x\' for XML dumping) - \"std\" for stdout: ");
-                               fflush(stdout);
-                               scanf("%s", radname);
-                               sExt = strrchr(radname, '.');
-                               xml_dump = 0;
-                               if (sExt) {
-                                       if (!stricmp(sExt, ".x")) xml_dump = 1;
-                                       sExt[0] = 0;
-                               }
-                               std_out = strnicmp(radname, "std", 3) ? 0 : 1;
-                               e = gf_term_dump_scene(term, std_out ? NULL : radname, NULL, xml_dump, 0, odm);
-                               fprintf(stdout, "Dump done (%s)\n", gf_error_to_string(e));
-                       }
-                       break;
-
-               case 'c':
-                       PrintGPACConfig();
-                       break;
-               case '3':
-               {
-                       Bool use_3d = !gf_term_get_option(term, GF_OPT_USE_OPENGL);
-                       if (gf_term_set_option(term, GF_OPT_USE_OPENGL, use_3d)==GF_OK) {
-                               fprintf(stdout, "Using %s for 2D drawing\n", use_3d ? "OpenGL" : "2D rasterizer");
-                       }
-               }
-                       break;
-               case 'k':
-               {
-                       Bool opt = gf_term_get_option(term, GF_OPT_STRESS_MODE);
-                       opt = !opt;
-                       fprintf(stdout, "Turning stress mode %s\n", opt ? "on" : "off");
-                       gf_term_set_option(term, GF_OPT_STRESS_MODE, opt);
-               }
-                       break;
-               case '4': gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3); break;
-               case '5': gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9); break;
-               case '6': gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN); break;
-               case '7': gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP); break;
-
-               case 'C':
-                       switch (gf_term_get_option(term, GF_OPT_MEDIA_CACHE)) {
-                       case GF_MEDIA_CACHE_DISABLED: gf_term_set_option(term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_ENABLED); break;
-                       case GF_MEDIA_CACHE_ENABLED: gf_term_set_option(term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISABLED); break;
-                       case GF_MEDIA_CACHE_RUNNING: fprintf(stdout, "Streaming Cache is running - please stop it first\n"); continue;
-                       }
-                       switch (gf_term_get_option(term, GF_OPT_MEDIA_CACHE)) {
-                       case GF_MEDIA_CACHE_ENABLED: fprintf(stdout, "Streaming Cache Enabled\n"); break;
-                       case GF_MEDIA_CACHE_DISABLED: fprintf(stdout, "Streaming Cache Disabled\n"); break;
-                       case GF_MEDIA_CACHE_RUNNING: fprintf(stdout, "Streaming Cache Running\n"); break;
-                       }
-                       break;
-               case 'S':
-               case 'A':
-                       if (gf_term_get_option(term, GF_OPT_MEDIA_CACHE)==GF_MEDIA_CACHE_RUNNING) {
-                               gf_term_set_option(term, GF_OPT_MEDIA_CACHE, (c=='S') ? GF_MEDIA_CACHE_DISABLED : GF_MEDIA_CACHE_DISCARD);
-                               fprintf(stdout, "Streaming Cache stopped\n");
-                       } else {
-                               fprintf(stdout, "Streaming Cache not running\n");
-                       }
-                       break;
-               case 'R':
-                       display_rti = !display_rti;
-                       ResetCaption();
-                       break;
-               case 'F':
-                       if (display_rti) display_rti = 0;
-                       else display_rti = 2;
-                       ResetCaption();
-                       break;
-
-               case 'u':
-               {
-                       GF_Err e;
-                       char szCom[8192];
-                       fprintf(stdout, "Enter command to send:\n");
-                       fflush(stdin);
-                       szCom[0] = 0;
-                       scanf("%[^\t\n]", szCom);
-                       e = gf_term_scene_update(term, NULL, szCom);
-                       if (e) fprintf(stdout, "Processing command failed: %s\n", gf_error_to_string(e));
-               }
-                       break;
-
-               case 'L':
-               {
-                       char szLog[1024];
-                       fprintf(stdout, "Enter new log level:\n");
-                       scanf("%s", szLog);
-                       gf_log_set_level(gf_log_parse_level(szLog));
-               }
-                       break;
-               case 'T':
-               {
-                       char szLog[1024];
-                       fprintf(stdout, "Enter new log tools:\n");
-                       scanf("%s", szLog);
-                       gf_log_set_tools(gf_log_parse_tools(szLog));
-               }
-                       break;
-               case 'g':
-               {
-                       GF_SystemRTInfo rti;
-                       gf_sys_get_rti(rti_update_time_ms, &rti, 0);
-                       fprintf(stdout, "GPAC allocated memory "LLD"\n", rti.gpac_memory);
-               }
-                       break;
-               case 'M':
-               {
-                       u32 size;
-                       fprintf(stdout, "Enter new video cache memory in kBytes (current %d):\n", gf_term_get_option(term, GF_OPT_VIDEO_CACHE_SIZE));
-                       scanf("%d", &size);
-                       gf_term_set_option(term, GF_OPT_VIDEO_CACHE_SIZE, size);
-               }
-                       break;
-
-               case 'E':
-                       gf_term_set_option(term, GF_OPT_RELOAD_CONFIG, 1); 
-                       break;
-
-               case 'B':
-                       switch_bench();
-                       break;
-
-               /*extract to PNG*/
-               case 'Z':
-               {
-                       GF_VideoSurface fb;
-                       GF_Err e;
-                       e = gf_term_get_screen_buffer(term, &fb);
-                       if (e) {
-                               fprintf(stdout, "Error dumping screen buffer %s\n", gf_error_to_string(e) );
-                       } else {
-                               u32 dst_size = fb.width*fb.height*3;
-                               char *dst=malloc(sizeof(char)*dst_size);
-
-                               e = gf_img_png_enc(fb.video_buffer, fb.width, fb.height, fb.pitch_y, fb.pixel_format, dst, &dst_size);
-                               if (e) {
-                                       fprintf(stdout, "Error encoding PNG %s\n", gf_error_to_string(e) );
-                               } else {
-                                       FILE *png = gf_f64_open("dump.png", "wb");
-                                       if (!png) {
-                                               fprintf(stdout, "Error writing file dump.png\n");
-                                       } else {
-                                               fwrite(dst, dst_size, 1, png);
-                                               fclose(png);
-                                               fprintf(stdout, "Writing file dump.png\n");
-                                       }
-                               }
-                               if (dst) free(dst);
-                               gf_term_release_screen_buffer(term, &fb);
-                       }
-               }
-                       break;
-
-               case 'h':
-                       PrintHelp();
-                       break;
-               default:
-                       break;
-               }
-       }
-
-       gf_term_disconnect(term);
-       if (rti_file) UpdateRTInfo("Disconnected\n");
-
-       fprintf(stdout, "Deleting terminal... ");
-       if (playlist) fclose(playlist);
-       gf_term_del(term);
-       fprintf(stdout, "OK\n");
-
-       fprintf(stdout, "GPAC cleanup ...\n");
-       gf_modules_del(user.modules);
-       gf_cfg_del(cfg_file);
-
-#ifdef GPAC_MEMORY_TRACKING
-       if (enable_mem_tracker) {
-               gf_memory_print();
-               fprintf(stdout, "print any key\n");
-               while (!gf_prompt_has_input()) {
-                       gf_sleep(100);
-               }
-       }
-#endif
-
-       gf_sys_close();
-       if (rti_logs) fclose(rti_logs);
-       if (logfile) fclose(logfile);
-       fprintf(stdout, "Bye\n");
-       return 0;
-}
-
-void PrintWorldInfo(GF_Terminal *term)
-{
-       u32 i;
-       const char *title;
-       GF_List *descs;
-       descs = gf_list_new();
-       title = gf_term_get_world_info(term, NULL, descs);
-       if (!title && !gf_list_count(descs)) {
-               fprintf(stdout, "No World Info available\n");
-       } else {
-               fprintf(stdout, "\t%s\n", title ? title : "No title available");
-               for (i=0; i<gf_list_count(descs); i++) {
-                       char *str = gf_list_get(descs, i);
-                       fprintf(stdout, "%s\n", str);
-               }
-       }
-       gf_list_del(descs);
-}
-
-void PrintODList(GF_Terminal *term, GF_ObjectManager *root_odm, u32 num, u32 indent, char *root_name)
-{
-       GF_MediaInfo odi;
-       u32 i, count;
-       char szIndent[50];
-       GF_ObjectManager *odm;
-
-       if (!root_odm) {
-               fprintf(stdout, "Currently loaded objects:\n");
-               root_odm = gf_term_get_root_object(term);
-       }
-       if (!root_odm) return;
-       if (gf_term_get_object_info(term, root_odm, &odi) != GF_OK) return;
-       if (!odi.od) {
-               fprintf(stdout, "Service not attached\n");
-               return;
-       }
-
-       for (i=0;i<indent;i++) szIndent[i]=' ';
-       szIndent[indent]=0;
-       
-       fprintf(stdout, "%s", szIndent);
-       fprintf(stdout, "#%d %s - ", num, root_name);
-       if (odi.media_url) {
-               fprintf(stdout, "%s\n", odi.media_url);
-       } else {
-               fprintf(stdout, "OD ID %d\n", odi.od->objectDescriptorID);
-       }
-
-       szIndent[indent]=' ';
-       szIndent[indent+1]=0;
-       indent++;
-
-       count = gf_term_get_object_count(term, root_odm);
-       for (i=0; i<count; i++) {
-               odm = gf_term_get_object(term, root_odm, i);
-               if (!odm) break;
-               num++;
-               if (gf_term_get_object_info(term, odm, &odi) == GF_OK) {
-                       switch (gf_term_object_subscene_type(term, odm)) {
-                       case 1:
-                               PrintODList(term, odm, num, indent, "Root");
-                               break;
-                       case 2:
-                               PrintODList(term, odm, num, indent, "Inline Scene");
-                               break;
-                       case 3:
-                               PrintODList(term, odm, num, indent, "EXTERNPROTO Library");
-                               break;
-                       default:
-                               fprintf(stdout, "%s", szIndent);
-                               fprintf(stdout, "#%d - ", num);
-                               if (odi.media_url) {
-                                       fprintf(stdout, "%s", odi.media_url);
-                               } else {
-                                       fprintf(stdout, "ID %d", odi.od->objectDescriptorID);
-                               }
-                               fprintf(stdout, " - %s\n", (odi.od_type==GF_STREAM_VISUAL) ? "Video" : (odi.od_type==GF_STREAM_AUDIO) ? "Audio" : "Systems");
-                               break;
-                       }
-               }
-       }
-}
-
-void ViewOD(GF_Terminal *term, u32 OD_ID, u32 number)
-{
-       GF_MediaInfo odi;
-       u32 i, j, count, d_enum,id;
-       GF_Err e;
-       char code[5];
-       NetStatCommand com;
-       GF_ObjectManager *odm, *root_odm = gf_term_get_root_object(term);
-       if (!root_odm) return;
-
-       odm = NULL;
-       if ((!OD_ID && (number == (u32)(-1))) ||
-               ((OD_ID == (u32)(-1)) && !number)) {
-               odm = root_odm;
-               if ((gf_term_get_object_info(term, odm, &odi) != GF_OK)) odm=NULL;
-       } else {
-               count = gf_term_get_object_count(term, root_odm);
-               for (i=0; i<count; i++) {
-                       odm = gf_term_get_object(term, root_odm, i);
-                       if (!odm) break;
-                       if (gf_term_get_object_info(term, odm, &odi) == GF_OK) {
-                               if ((number == (u32)(-1)) && (odi.od->objectDescriptorID == OD_ID)) break;
-                               else if (i == (u32)(number-1)) break;
-                       }
-                       odm = NULL;
-               }
-       }
-       if (!odm) {
-               if (number == (u32)-1) fprintf(stdout, "cannot find OD with ID %d\n", OD_ID);
-               else fprintf(stdout, "cannot find OD with number %d\n", number);
-               return;
-       }
-       if (!odi.od) {
-               if (number == (u32)-1) fprintf(stdout, "Object %d not attached yet\n", OD_ID);
-               else fprintf(stdout, "Object #%d not attached yet\n", number);          
-               return;
-       }
-
-       if (!odi.od) {
-               fprintf(stdout, "Service not attached\n");
-               return;
-       }
-
-       if (odi.od->tag==GF_ODF_IOD_TAG) {
-               fprintf(stdout, "InitialObjectDescriptor %d\n", odi.od->objectDescriptorID);
-               fprintf(stdout, "Profiles and Levels: Scene %x - Graphics %x - Visual %x - Audio %x - OD %x\n", 
-                       odi.scene_pl, odi.graphics_pl, odi.visual_pl, odi.audio_pl, odi.OD_pl);
-               fprintf(stdout, "Inline Profile Flag %d\n", odi.inline_pl);
-       } else {
-               fprintf(stdout, "ObjectDescriptor %d\n", odi.od->objectDescriptorID);
-       }
-
-       fprintf(stdout, "Object Duration: ");
-       if (odi.duration) {
-         PrintTime((u32) (odi.duration*1000));
-       } else {
-         fprintf(stdout, "unknown");
-       }
-       fprintf(stdout, "\n");
-
-       if (odi.owns_service) {
-               fprintf(stdout, "Service Handler: %s\n", odi.service_handler);
-               fprintf(stdout, "Service URL: %s\n", odi.service_url);
-       }               
-       if (odi.codec_name) {
-               Float avg_dec_time;
-               switch (odi.od_type) {
-               case GF_STREAM_VISUAL:
-                       fprintf(stdout, "Video Object: Width %d - Height %d\r\n", odi.width, odi.height);
-                       fprintf(stdout, "Media Codec: %s\n", odi.codec_name);
-                       if (odi.par) fprintf(stdout, "Pixel Aspect Ratio: %d:%d\n", (odi.par>>16)&0xFF, (odi.par)&0xFF);
-                       break;
-               case GF_STREAM_AUDIO:
-                       fprintf(stdout, "Audio Object: Sample Rate %d - %d channels\r\n", odi.sample_rate, odi.num_channels);
-                       fprintf(stdout, "Media Codec: %s\n", odi.codec_name);
-                       break;
-               case GF_STREAM_SCENE:
-               case GF_STREAM_PRIVATE_SCENE:
-                       if (odi.width && odi.height) {
-                               fprintf(stdout, "Scene Description - Width %d - Height %d\n", odi.width, odi.height);
-                       } else {
-                               fprintf(stdout, "Scene Description - no size specified\n");
-                       }
-                       fprintf(stdout, "Scene Codec: %s\n", odi.codec_name);
-                       break;
-               case GF_STREAM_TEXT:
-                       if (odi.width && odi.height) {
-                               fprintf(stdout, "Text Object: Width %d - Height %d\n", odi.width, odi.height);
-                       } else {
-                               fprintf(stdout, "Text Object: No size specified\n");
-                       }
-                       fprintf(stdout, "Text Codec %s\n", odi.codec_name);
-                       break;
-               }
-       
-               avg_dec_time = 0;
-               if (odi.nb_dec_frames) { 
-                       avg_dec_time = (Float) odi.total_dec_time; 
-                       avg_dec_time /= odi.nb_dec_frames; 
-               }
-               fprintf(stdout, "\tBitrate over last second: %d kbps\n\tMax bitrate over one second: %d kbps\n\tAverage Decoding Time %.2f ms (%d max)\n\tTotal decoded frames %d\n", 
-                       (u32) odi.avg_bitrate/1024, odi.max_bitrate/1024, avg_dec_time, odi.max_dec_time, odi.nb_dec_frames);
-       }
-       if (odi.protection) fprintf(stdout, "Encrypted Media%s\n", (odi.protection==2) ? " NOT UNLOCKED" : "");
-
-       count = gf_list_count(odi.od->ESDescriptors);
-       fprintf(stdout, "%d streams in OD\n", count);
-       for (i=0; i<count; i++) {
-               GF_ESD *esd = (GF_ESD *) gf_list_get(odi.od->ESDescriptors, i);
-
-               fprintf(stdout, "\nStream ID %d - Clock ID %d\n", esd->ESID, esd->OCRESID);
-               if (esd->dependsOnESID) fprintf(stdout, "\tDepends on Stream ID %d for decoding\n", esd->dependsOnESID);
-
-               switch (esd->decoderConfig->streamType) {
-               case GF_STREAM_OD: fprintf(stdout, "\tOD Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_OCR: fprintf(stdout, "\tOCR Stream\n"); break;
-               case GF_STREAM_SCENE: fprintf(stdout, "\tScene Description Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_VISUAL:
-                       fprintf(stdout, "\tVisual Stream - media type: ");
-                       switch (esd->decoderConfig->objectTypeIndication) {
-                       case GPAC_OTI_VIDEO_MPEG4_PART2: fprintf(stdout, "MPEG-4\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SIMPLE: fprintf(stdout, "MPEG-2 Simple Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_MAIN: fprintf(stdout, "MPEG-2 Main Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SNR: fprintf(stdout, "MPEG-2 SNR Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SPATIAL: fprintf(stdout, "MPEG-2 Spatial Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_HIGH: fprintf(stdout, "MPEG-2 High Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_422: fprintf(stdout, "MPEG-2 422 Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG1: fprintf(stdout, "MPEG-1\n"); break;
-                       case GPAC_OTI_IMAGE_JPEG: fprintf(stdout, "JPEG\n"); break;
-                       case GPAC_OTI_IMAGE_PNG: fprintf(stdout, "PNG\n"); break;
-                       case GPAC_OTI_IMAGE_JPEG_2000: fprintf(stdout, "JPEG2000\n"); break;
-                               
-                       case GPAC_OTI_MEDIA_GENERIC:
-                               memcpy(code, esd->decoderConfig->decoderSpecificInfo->data, 4);
-                               code[4] = 0;
-                               fprintf(stdout, "GPAC Intern (%s)\n", code);
-                               break;
-                       default:
-                               fprintf(stdout, "Private Type (0x%x)\n", esd->decoderConfig->objectTypeIndication);
-                               break;
-                       }
-                       break;
-
-               case GF_STREAM_AUDIO:
-                       fprintf(stdout, "\tAudio Stream - media type: ");
-                       switch (esd->decoderConfig->objectTypeIndication) {
-                       case GPAC_OTI_AUDIO_AAC_MPEG4: fprintf(stdout, "MPEG-4\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_MP: fprintf(stdout, "MPEG-2 AAC Main Profile\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_LCP: fprintf(stdout, "MPEG-2 AAC LowComplexity Profile\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_SSRP: fprintf(stdout, "MPEG-2 AAC Scalable Sampling Rate Profile\n"); break;
-                       case GPAC_OTI_AUDIO_MPEG2_PART3: fprintf(stdout, "MPEG-2 Audio\n"); break;
-                       case GPAC_OTI_AUDIO_MPEG1: fprintf(stdout, "MPEG-1 Audio\n"); break;
-                       case GPAC_OTI_AUDIO_EVRC_VOICE: fprintf(stdout, "EVRC Audio\n"); break;
-                       case GPAC_OTI_AUDIO_SMV_VOICE: fprintf(stdout, "SMV Audio\n"); break;
-                       case GPAC_OTI_AUDIO_13K_VOICE: fprintf(stdout, "QCELP Audio\n"); break;
-                       case GPAC_OTI_MEDIA_GENERIC:
-                               memcpy(code, esd->decoderConfig->decoderSpecificInfo->data, 4);
-                               code[4] = 0;
-                               fprintf(stdout, "GPAC Intern (%s)\n", code);
-                               break;
-                       default:
-                               fprintf(stdout, "Private Type (0x%x)\n", esd->decoderConfig->objectTypeIndication);
-                               break;
-                       }
-                       break;
-               case GF_STREAM_MPEG7: fprintf(stdout, "\tMPEG-7 Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_IPMP: fprintf(stdout, "\tIPMP Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_OCI: fprintf(stdout, "\tOCI Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_MPEGJ: fprintf(stdout, "\tMPEGJ Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_INTERACT: fprintf(stdout, "\tUser Interaction Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               case GF_STREAM_TEXT: fprintf(stdout, "\tStreaming Text Stream - version %d\n", esd->decoderConfig->objectTypeIndication); break;
-               default: fprintf(stdout, "Unknown Stream\r\n"); break;
-               }
-
-               fprintf(stdout, "\tBuffer Size %d\n\tAverage Bitrate %d bps\n\tMaximum Bitrate %d bps\n", esd->decoderConfig->bufferSizeDB, esd->decoderConfig->avgBitrate, esd->decoderConfig->maxBitrate);
-               if (esd->slConfig->predefined==SLPredef_SkipSL) {
-                       fprintf(stdout, "\tNot using MPEG-4 Synchronization Layer\n");
-               } else {
-                       fprintf(stdout, "\tStream Clock Resolution %d\n", esd->slConfig->timestampResolution);
-               }
-               if (esd->URLString) fprintf(stdout, "\tStream Location: %s\n", esd->URLString);
-
-               /*check language*/
-               if (esd->langDesc) {
-                       u32 i=0;
-                       char lan[4], *szLang;
-                       lan[0] = esd->langDesc->langCode>>16;
-                       lan[1] = (esd->langDesc->langCode>>8)&0xFF;
-                       lan[2] = (esd->langDesc->langCode)&0xFF;
-                       lan[3] = 0;
-
-                       if ((lan[0]=='u') && (lan[1]=='n') && (lan[2]=='d')) szLang = "Undetermined";
-                       else {
-                               szLang = lan;
-                               while (GF_ISO639_Lang[i]) {
-                                       if (GF_ISO639_Lang[i+2][0] && strstr(GF_ISO639_Lang[i+1], lan)) {
-                                               szLang = (char*) GF_ISO639_Lang[i];
-                                               break;
-                                       }
-                                       i+=3;
-                               }
-                       }
-                       fprintf(stdout, "\tStream Language: %s\n", szLang);
-               }
-       }
-       fprintf(stdout, "\n");
-       /*check OCI (not everything interests us) - FIXME: support for unicode*/
-       count = gf_list_count(odi.od->OCIDescriptors);
-       if (count) {
-               fprintf(stdout, "%d Object Content Information descriptors in OD\n", count);
-               for (i=0; i<count; i++) {
-                       GF_Descriptor *desc = (GF_Descriptor *) gf_list_get(odi.od->OCIDescriptors, i);
-                       switch (desc->tag) {
-                       case GF_ODF_SEGMENT_TAG:
-                       {
-                               GF_Segment *sd = (GF_Segment *) desc;
-                               fprintf(stdout, "Segment Descriptor: Name: %s - start time %g sec - duration %g sec\n", sd->SegmentName, sd->startTime, sd->Duration);
-                       }
-                               break;
-                       case GF_ODF_CC_NAME_TAG:
-                       {
-                               GF_CC_Name *ccn = (GF_CC_Name *)desc;
-                               fprintf(stdout, "Content Creators:\n");
-                               for (j=0; j<gf_list_count(ccn->ContentCreators); j++) {
-                                       GF_ContentCreatorInfo *ci = (GF_ContentCreatorInfo *) gf_list_get(ccn->ContentCreators, j);
-                                       if (!ci->isUTF8) continue;
-                                       fprintf(stdout, "\t%s\n", ci->contentCreatorName);
-                               }
-                       }
-                               break;
-
-                       case GF_ODF_SHORT_TEXT_TAG:
-                               {
-                                       GF_ShortTextual *std = (GF_ShortTextual *)desc;
-                                       fprintf(stdout, "Description:\n\tEvent: %s\n\t%s\n", std->eventName, std->eventText);
-                               }
-                               break;
-                       default:
-                               break;
-                       }
-               }
-               fprintf(stdout, "\n");
-       }
-
-       switch (odi.status) {
-       case 0: fprintf(stdout, "Stopped - "); break;
-       case 1: fprintf(stdout, "Playing - "); break;
-       case 2: fprintf(stdout, "Paused - "); break;
-       case 3: fprintf(stdout, "Not setup yet\n"); return;
-       default: fprintf(stdout, "Setup Failed\n"); return;
-       }
-       if (odi.buffer>=0) fprintf(stdout, "Buffer: %d ms - ", odi.buffer);
-       else fprintf(stdout, "Not buffering - ");
-       fprintf(stdout, "Clock drift: %d ms\n", odi.clock_drift);
-       if (odi.db_unit_count) fprintf(stdout, "%d AU in DB\n", odi.db_unit_count);
-       if (odi.cb_max_count) fprintf(stdout, "Composition Buffer: %d CU (%d max)\n", odi.cb_unit_count, odi.cb_max_count);
-       fprintf(stdout, "\n");
-
-       if (odi.owns_service) {
-               const char *url;
-               u32 done, total, bps;
-               d_enum = 0;
-               while (gf_term_get_download_info(term, odm, &d_enum, &url, NULL, &done, &total, &bps)) {
-                       if (d_enum==1) fprintf(stdout, "Current Downloads in service:\n");
-                       if (done && total) {
-                               fprintf(stdout, "%s: %d / %d bytes (%.2f %%) - %.2f kBps\n", url, done, total, (100.0f*done)/total, ((Float)bps)/1024.0f);
-                       } else {
-                               fprintf(stdout, "%s: %.2f kbps\n", url, ((Float)8*bps)/1024.0f);
-                       }
-               }
-               if (!d_enum) fprintf(stdout, "No Downloads in service\n");
-               fprintf(stdout, "\n");
-       }
-       d_enum = 0;
-       while (gf_term_get_channel_net_info(term, odm, &d_enum, &id, &com, &e)) {
-               if (e) continue;
-               if (!com.bw_down && !com.bw_up) continue;
-
-               fprintf(stdout, "Stream ID %d statistics:\n", id);
-               if (com.multiplex_port) {
-                       fprintf(stdout, "\tMultiplex Port %d - multiplex ID %d\n", com.multiplex_port, com.port);
-               } else {
-                       fprintf(stdout, "\tPort %d\n", com.port);
-               }
-               fprintf(stdout, "\tPacket Loss Percentage: %.4f\n", com.pck_loss_percentage);
-               fprintf(stdout, "\tDown Bandwidth: %d bps\n", com.bw_down);
-               if (com.bw_up) fprintf(stdout, "\tUp Bandwidth: %d bps\n", com.bw_up);
-               if (com.ctrl_port) {
-                       if (com.multiplex_port) {
-                               fprintf(stdout, "\tControl Multiplex Port: %d - Control Multiplex ID %d\n", com.multiplex_port, com.ctrl_port);
-                       } else {
-                               fprintf(stdout, "\tControl Port: %d\n", com.ctrl_port);
-                       }
-                       fprintf(stdout, "\tDown Bandwidth: %d bps\n", com.ctrl_bw_down);
-                       fprintf(stdout, "\tUp Bandwidth: %d bps\n", com.ctrl_bw_up);
-               }
-               fprintf(stdout, "\n");
-       }
-}
-
-void PrintODTiming(GF_Terminal *term, GF_ObjectManager *odm)
-{
-       GF_MediaInfo odi;
-       if (!odm) return;
-
-       if (gf_term_get_object_info(term, odm, &odi) != GF_OK) return;
-       if (!odi.od) {
-               fprintf(stdout, "Service not attached\n");
-               return;
-       }
-
-       fprintf(stdout, "OD %d: ", odi.od->objectDescriptorID);
-       switch (odi.status) {
-       case 1: fprintf(stdout, "Playing - "); break;
-       case 2: fprintf(stdout, "Paused - "); break;
-       default: fprintf(stdout, "Stopped - "); break;
-       }
-       if (odi.buffer>=0) fprintf(stdout, "Buffer: %d ms - ", odi.buffer);
-       else fprintf(stdout, "Not buffering - ");
-       fprintf(stdout, "Clock drift: %d ms", odi.clock_drift);
-       fprintf(stdout, " - time: ");
-       PrintTime((u32) (odi.current_time*1000));
-       fprintf(stdout, "\n");
-}
-
-void PrintODBuffer(GF_Terminal *term, GF_ObjectManager *odm)
-{
-       Float avg_dec_time;
-       GF_MediaInfo odi;
-       if (!odm) return;
-
-       if (gf_term_get_object_info(term, odm, &odi) != GF_OK) return;
-       if (!odi.od) {
-               fprintf(stdout, "Service not attached\n");
-               return;
-       }
-
-       fprintf(stdout, "OD %d: ", odi.od->objectDescriptorID);
-       switch (odi.status) {
-       case 1: fprintf(stdout, "Playing"); break;
-       case 2: fprintf(stdout, "Paused"); break;
-       default: fprintf(stdout, "Stopped"); break;
-       }
-       if (odi.buffer>=0) fprintf(stdout, " - Buffer: %d ms", odi.buffer);
-       if (odi.db_unit_count) fprintf(stdout, " - DB: %d AU", odi.db_unit_count);
-       if (odi.cb_max_count) fprintf(stdout, " - CB: %d/%d CUs", odi.cb_unit_count, odi.cb_max_count);
-       
-       fprintf(stdout, "\n * %d decoded frames - %d dropped frames\n", odi.nb_dec_frames, odi.nb_droped);
-       avg_dec_time = 0;
-       if (odi.nb_dec_frames) { avg_dec_time = (Float) odi.total_dec_time; avg_dec_time /= odi.nb_dec_frames; }
-       fprintf(stdout, " * Avg Bitrate %d kbps (%d max) - Avg Decoding Time %.2f ms (%d max)\n",
-                                                               (u32) odi.avg_bitrate/1024, odi.max_bitrate/1024, avg_dec_time, odi.max_dec_time);
-}
-
-void ViewODs(GF_Terminal *term, Bool show_timing)
-{
-       u32 i, count;
-       GF_ObjectManager *odm, *root_odm = gf_term_get_root_object(term);
-       if (!root_odm) return;
-
-       if (show_timing) {
-               PrintODTiming(term, root_odm);
-       } else {
-               PrintODBuffer(term, root_odm);
-       }
-       count = gf_term_get_object_count(term, root_odm);
-       for (i=0; i<count; i++) {
-               odm = gf_term_get_object(term, root_odm, i);
-               if (show_timing) {
-                       PrintODTiming(term, odm);
-               } else {
-                       PrintODBuffer(term, odm);
-               }
-       }
-       fprintf(stdout, "\n");
-}
-
-
-void PrintGPACConfig()
-{
-       u32 i, j, cfg_count, key_count;
-       char szName[200];
-       char *secName = NULL;
-
-       fprintf(stdout, "Enter section name (\"*\" for complete dump):\n");
-       scanf("%s", szName);
-       if (strcmp(szName, "*")) secName = szName;
-
-       fprintf(stdout, "\n\n*** GPAC Configuration ***\n\n");
-
-       cfg_count = gf_cfg_get_section_count(cfg_file);
-       for (i=0; i<cfg_count; i++) {
-               const char *sec = gf_cfg_get_section_name(cfg_file, i);
-               if (secName) {
-                       if (stricmp(sec, secName)) continue;
-               } else {
-                       if (!stricmp(sec, "General")) continue;
-                       if (!stricmp(sec, "MimeTypes")) continue;
-                       if (!stricmp(sec, "RecentFiles")) continue;
-               }
-               fprintf(stdout, "[%s]\n", sec);
-               key_count = gf_cfg_get_key_count(cfg_file, sec);
-               for (j=0; j<key_count; j++) {
-                       const char *key = gf_cfg_get_key_name(cfg_file, sec, j);
-                       const char *val = gf_cfg_get_key(cfg_file, sec, key);
-                       fprintf(stdout, "%s=%s\n", key, val);
-               }
-               fprintf(stdout, "\n");
-       }
-}
diff --git a/applications/osmo4_ios/osmo4ios-Info.plist b/applications/osmo4_ios/osmo4ios-Info.plist
deleted file mode 100644 (file)
index 2c7f467..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>CFBundleDevelopmentRegion</key>
-       <string>English</string>
-       <key>CFBundleExecutable</key>
-       <string>${EXECUTABLE_NAME}</string>
-       <key>CFBundleIdentifier</key>
-       <string>com.gpac.${PRODUCT_NAME:identifier}</string>
-       <key>CFBundleInfoDictionaryVersion</key>
-       <string>6.0</string>
-       <key>CFBundleName</key>
-       <string>Osmo4</string>
-       <key>CFBundlePackageType</key>
-       <string>APPL</string>
-       <key>CFBundleShortVersionString</key>
-       <string>9.9.9</string><!-- VERSION_REV_REPLACE -->
-       <key>CFBundleSignature</key>
-       <string>gpac</string>
-       <key>CFBundleVersion</key>
-       <string>9999</string><!-- BUILD_REV_REPLACE -->
-</dict>
-</plist>
diff --git a/applications/osmo4_sym/aif/osmo4_icon.bmp b/applications/osmo4_sym/aif/osmo4_icon.bmp
deleted file mode 100644 (file)
index f811efd..0000000
Binary files a/applications/osmo4_sym/aif/osmo4_icon.bmp and /dev/null differ
diff --git a/applications/osmo4_sym/aif/osmo4_icon_mask.bmp b/applications/osmo4_sym/aif/osmo4_icon_mask.bmp
deleted file mode 100644 (file)
index cff9766..0000000
Binary files a/applications/osmo4_sym/aif/osmo4_icon_mask.bmp and /dev/null differ
diff --git a/applications/osmo4_sym/aif/osmo4_menu.bmp b/applications/osmo4_sym/aif/osmo4_menu.bmp
deleted file mode 100644 (file)
index f44d9b1..0000000
Binary files a/applications/osmo4_sym/aif/osmo4_menu.bmp and /dev/null differ
diff --git a/applications/osmo4_sym/aif/osmo4_menu_mask.bmp b/applications/osmo4_sym/aif/osmo4_menu_mask.bmp
deleted file mode 100644 (file)
index 4f02c67..0000000
Binary files a/applications/osmo4_sym/aif/osmo4_menu_mask.bmp and /dev/null differ
diff --git a/applications/osmo4_sym/aif/osmo4aif.rss b/applications/osmo4_sym/aif/osmo4aif.rss
deleted file mode 100644 (file)
index 7279af2..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Copyright (c) 2004, Nokia. All rights reserved */
-
-#include <aiftool.rh>
-
-RESOURCE AIF_DATA
-    {
-
-    app_uid = 0x1000AC00;
-    num_icons = 2;
-    embeddability = KAppNotEmbeddable;
-    newfile = KAppDoesNotSupportNewFile;
-    }
-
-// End of File
diff --git a/applications/osmo4_sym/osmo4.cpp b/applications/osmo4_sym/osmo4.cpp
deleted file mode 100644 (file)
index 07e5001..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#include "osmo4.h"
-#include "osmo4_ui.h"
-
-
-EXPORT_C CApaApplication* NewApplication()
-       {
-       return new COsmo4Application;
-       }
-
-
-#ifdef EKA2
-
-#include <eikstart.h>
-
-GLDEF_C TInt E32Main() 
-{
-    return EikStart::RunApplication( NewApplication );
-}
-
-#else
-
-
-GLDEF_C TInt E32Dll( TDllReason /*aReason*/ )
-{
-    return KErrNone;
-}
-
-#endif
-
-
-#if defined(__SERIES60_3X__)
-const TUid KUidOsmo4App = { 0xf01f9075 };
-#else
-const TUid KUidOsmo4App = { 0x1000AC00 };
-#endif
-
-
-CApaDocument* COsmo4Application::CreateDocumentL()
-{
-    return (static_cast<CApaDocument*> ( COsmo4Document::NewL( *this ) ) );
-}
-
-TUid COsmo4Application::AppDllUid() const
-{
-    return KUidOsmo4App;
-}
-
-
-COsmo4Document* COsmo4Document::NewL( CEikApplication& aApp )
-{
-    COsmo4Document* self = NewLC( aApp );
-    CleanupStack::Pop( self );
-    return self;
-}
-
-COsmo4Document* COsmo4Document::NewLC( CEikApplication& aApp )
-{
-    COsmo4Document* self =
-        new ( ELeave ) COsmo4Document( aApp );
-
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-}
-void COsmo4Document::ConstructL()
-{
-}
-
-COsmo4Document::COsmo4Document( CEikApplication& aApp )
-    : CAknDocument( aApp )
-{
-}
-
-COsmo4Document::~COsmo4Document()
-{
-}
-
-CEikAppUi* COsmo4Document::CreateAppUiL()
-{
-    return ( static_cast <CEikAppUi*> ( new ( ELeave ) COsmo4AppUi ) );
-}
-
diff --git a/applications/osmo4_sym/osmo4.h b/applications/osmo4_sym/osmo4.h
deleted file mode 100644 (file)
index e01c614..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (c) 2004, Nokia. All rights reserved */
-
-
-#ifndef __OSMO4_H__
-#define __OSMO4_H__
-
-// INCLUDES
-#include <aknapp.h>
-#include <akndoc.h>
-
-class COsmo4Application : public CAknApplication
-{
-    public:
-        TUid AppDllUid() const;
-
-    protected:
-        CApaDocument* CreateDocumentL();
-    };
-
-
-class COsmo4Document : public CAknDocument
-    {
-    public:
-        static COsmo4Document* NewL( CEikApplication& aApp );
-        static COsmo4Document* NewLC( CEikApplication& aApp );
-        virtual ~COsmo4Document();
-
-    public: 
-        CEikAppUi* CreateAppUiL();
-
-    private:
-        void ConstructL();
-        COsmo4Document( CEikApplication& aApp );
-
-    };
-
-#endif // __OSMO4_H__
-
diff --git a/applications/osmo4_sym/osmo4_ui.cpp b/applications/osmo4_sym/osmo4_ui.cpp
deleted file mode 100644 (file)
index 1b82c88..0000000
+++ /dev/null
@@ -1,604 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) ENST 2006-200X
- *                             Authors: Jean Le Feuvre 
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Symbian GUI player
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- */
-
-
-// INCLUDE FILES
-#include <avkon.hrh>
-#include <eikmenup.h>
-#include <akntitle.h>
-
-#include <stringloader.h>
-#include <osmo4.rsg>
-#include <f32file.h>
-#include <s32file.h>
-#include <bacline.h>
-#include <eikbtgps.h>
-#include <aknquerydialog.h> 
-
-
-#include "osmo4_ui.h"
-#include "osmo4_view.h"
-#include "playlist.h"
-
-#include <gpac/utf.h>
-#include <gpac/options.h>
-
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-
-// -----------------------------------------------------------------------------
-// Cosmo4AppUi::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppUi::ConstructL()
-{
-    // Initialise app UI with standard value.
-    BaseConstructL(CAknAppUi::EAknEnableSkin);
-
-    /*Create display*/
-    iAppView = COsmo4AppView::NewL( ClientRect() );
-       AddToStackL(iAppView);
-
-       /*create playlist*/
-#ifndef GPAC_GUI_ONLY
-       iPlaylist = CPlaylist::NewL( ClientRect(), iAppView->GetUser() );
-
-       iPlaylist->MakeVisible(EFalse);
-#endif
-       
-       iAppView->MakeVisible(ETrue);
-       view_mode = 0;
-
-       m_title = NULL;
-
-       //StatusPane ()->SwitchLayoutL ( R_AVKON_STATUS_PANE_LAYOUT_SMALL );
-
-       nb_keys = 0;
-       CaptureKeys(1);
-
-
-
-       CCommandLineArguments *args = CCommandLineArguments::NewL();
-#ifndef GPAC_GUI_ONLY
-       if (args->Count() > 1) {
-               TPtrC url = args->Arg(1);
-#if defined(_UNICODE)
-               char szURL[1024];
-               u16 szURLUTF16[1024];
-               size_t len;
-               len = url.Size();
-               memcpy(szURLUTF16, url.Ptr(), sizeof(u8)*len);
-               szURLUTF16[len/2] = 0;
-               const u16 *sptr = szURLUTF16;
-               len = gf_utf8_wcstombs(szURL, 512, &sptr);
-               if (len != (size_t) -1) {
-                       szURL[len] = 0;
-                       iAppView->Connect((const char *)szURL);
-               }
-#else
-               iAppView->Connect((const char *)url.Ptr());
-#endif
-       }
-#endif
-       delete args;
-}
-
-// -----------------------------------------------------------------------------
-// COsmo4AppUi::COsmo4AppUi()
-// C++ default constructor can NOT contain any code, that might leave.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppUi::COsmo4AppUi()
-    {
-    // No implementation required
-    }
-
-// -----------------------------------------------------------------------------
-// COsmo4AppUi::~COsmo4AppUi()
-// Destructor.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppUi::~COsmo4AppUi()
-{
-       CaptureKeys(0);
-
-       switch (view_mode) {
-       case 0:
-               if (iAppView) RemoveFromStack(iAppView);
-               break;
-       case 1:
-               if (iPlaylist) RemoveFromStack(iPlaylist);
-               break;
-       }
-    if (iAppView) delete iAppView;
-    if (iPlaylist) delete iPlaylist;
-       if (m_title) gf_free(m_title);
-       m_title = NULL;
-}
-
-
-void COsmo4AppUi::CaptureKey(TInt32 code, TInt32 scancode)
-{
-       RWindowGroup iWG = CCoeEnv::Static()->RootWin();
-       if (nb_keys>=MAX_KEY_CAP) return;
-       keys[nb_keys].key_cap = iWG.CaptureKey(code, 0, 0);
-       keys[nb_keys].key_cap_ud = iWG.CaptureKeyUpAndDowns(scancode, 0, 0);
-       nb_keys++;
-}
-/*
-possible meaning for key codes:
-EStdKeyYes          -Call
-EStdKeyNo           -End
-EStdKeyApplication0 -Apps key
-EStdKeyDevice0      -Left softkey
-EStdKeyDevice1      -Right softkey
-EStdKeyDevice2      -Power
-EStdKeyDevice3      -Button press
-EStdKeyDevice4      -Flip - Open
-EStdKeyDevice5      -Flip - Close
-EStdKeyDevice6      -Side key
-
-EStdKeyDeviceD         -Jog Dial forward
-EStdKeyDeviceE         -Jog Dial back
-*/
-void COsmo4AppUi::CaptureKeys(int do_capture)
-{
-       if (do_capture) {
-               CaptureKey(EKeyIncVolume, EStdKeyIncVolume);
-               CaptureKey(EKeyDecVolume, EStdKeyDecVolume);
-       } else {
-               RWindowGroup iWG = CCoeEnv::Static()->RootWin();
-               for (int i=0; i<nb_keys; i++) {
-                       iWG.CancelCaptureKey(keys[i].key_cap);
-                       iWG.CancelCaptureKeyUpAndDowns(keys[i].key_cap_ud);
-               }
-               nb_keys = 0;
-       }
-}
-
-
-void COsmo4AppUi::HandleForegroundEventL(TBool aForeground)
-{
-       CaptureKeys(aForeground ? 1 : 0);
-       CAknAppUi::HandleForegroundEventL(aForeground);
-}
-
-// -----------------------------------------------------------------------------
-// COsmo4AppUi::HandleCommandL()
-// Takes care of command handling.
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppUi::HandleCommandL( TInt aCommand )
-{
-       GF_Err e;
-#ifndef GPAC_GUI_ONLY
-       switch( aCommand ) {
-       case EAknSoftkeyBack:
-               if (view_mode==1) TogglePlaylist();
-               break;
-    case EEikCmdExit:
-    case EAknSoftkeyExit:
-        iAppView->Shutdown();
-               Exit();
-        break;
-       /*PLAYLIST commands*/
-       case EOsmo4PlayListAdd:
-               iPlaylist->PlaylistAct(Osmo4PLAdd);
-               break;
-       case EOsmo4PlayListRem:
-               iPlaylist->PlaylistAct(Osmo4PLRem);
-               break;
-       case EOsmo4PlayListMoveUp:
-               iPlaylist->PlaylistAct(Osmo4PLMoveUp);
-               break;
-       case EOsmo4PlayListMoveDown:
-               iPlaylist->PlaylistAct(Osmo4PLMoveDown);
-               break;
-       case EOsmo4PlayListClear:
-               iPlaylist->PlaylistAct(Osmo4PLClear);
-               break;
-       case EOsmo4PlayListMode:
-               iPlaylist->PlaylistAct(Osmo4PLToggleMode);
-               break;
-       case EOsmo4PlayListAllFiles:
-               iPlaylist->PlaylistAct(Osmo4PLToggleAllFiles);
-               break;
-
-       /*FILE menu command*/
-       case EOsmo4PlayListView:
-               TogglePlaylist();
-               break;
-       case EOsmo4OpenURL:
-               break;
-       case EOsmo4Fullscreen:
-               break;
-       case EOsmo4ViewMaxSize:
-       {
-               CEikStatusPane* statusPane = StatusPane();
-               if (statusPane->IsVisible()) statusPane->MakeVisible(EFalse);
-               else statusPane->MakeVisible(ETrue);
-       }
-               break;
-       case EOsmo4AROriginal:
-               gf_term_set_option(iAppView->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);
-               break;
-       case EOsmo4ARFillScreen:
-               gf_term_set_option(iAppView->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN);
-               break;
-       case EOsmo4AR4_3:
-               gf_term_set_option(iAppView->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3);
-               break;
-       case EOsmo4AR16_9:
-               gf_term_set_option(iAppView->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9);
-               break;
-
-       case EOsmo4NavReset:
-               gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION_TYPE, 0);
-               break;
-       case EOsmo4NavNone:
-               gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_NONE);
-               break;
-       case EOsmo4NavSlide:
-               e = gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_SLIDE);
-               if (e) {
-                       GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("Cannot set navigation: %s", gf_error_to_string(e) ));
-               }
-               break;
-       case EOsmo4NavWalk:
-               gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_WALK);
-               break;
-       case EOsmo4NavFly:
-               gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_FLY);
-               break;
-       case EOsmo4NavExamine:
-               gf_term_set_option(iAppView->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_EXAMINE);
-               break;
-       case EOsmo4NavHeadlight:
-               gf_term_set_option(iAppView->m_term, GF_OPT_HEADLIGHT, !gf_term_get_option(iAppView->m_term, GF_OPT_HEADLIGHT) );
-               break;
-       case EOsmo4CollideNone:
-               gf_term_set_option(iAppView->m_term, GF_OPT_COLLISION, GF_COLLISION_NONE);
-               break;
-       case EOsmo4CollideSimple:
-               gf_term_set_option(iAppView->m_term, GF_OPT_COLLISION, GF_COLLISION_NORMAL);
-               break;
-       case EOsmo4CollideDisp:
-               gf_term_set_option(iAppView->m_term, GF_OPT_COLLISION, GF_COLLISION_DISPLACEMENT);
-               break;
-       case EOsmo4NavGravity:
-               gf_term_set_option(iAppView->m_term, GF_OPT_GRAVITY, !gf_term_get_option(iAppView->m_term, GF_OPT_GRAVITY));
-               break;
-       case EOsmo4ViewRTI:
-               iAppView->show_rti = !iAppView->show_rti;
-               break;
-
-    case EOsmo4OptEnableLogs:
-    {
-               const char *opt = gf_cfg_get_key(iAppView->m_user.config, "General", "LogLevel");
-               if (opt && !stricmp(opt, "debug")) {
-                       gf_cfg_set_key(iAppView->m_user.config, "General", "LogLevel", "error");
-               } else {
-                       gf_cfg_set_key(iAppView->m_user.config, "General", "LogLevel", "debug");
-               }
-               iAppView->SetupLogs();
-    }
-        break;
-       case EOsmo4OptOpenGL:
-       {
-               const char *opt = gf_cfg_get_key(iAppView->m_user.config, "Compositor", "ForceOpenGL");
-               Bool use_gl = (opt && !strcmp(opt, "yes")) ? 1 : 0;
-               gf_cfg_set_key(iAppView->m_user.config, "Compositor", "ForceOpenGL", use_gl ? "no" : "yes");
-               gf_term_set_option(iAppView->m_term, GF_OPT_USE_OPENGL, !use_gl);
-       }
-               break;
-       case EOsmo4OptDirectDraw:
-       {
-               const char *opt = gf_cfg_get_key(iAppView->m_user.config, "Compositor", "DirectDraw");
-               Bool use_dd = (opt && !strcmp(opt, "yes")) ? 1 : 0;
-               gf_cfg_set_key(iAppView->m_user.config, "Compositor", "DirectDraw", use_dd ? "no" : "yes");
-               gf_term_set_option(iAppView->m_term, GF_OPT_DIRECT_DRAW, !use_dd);
-       }
-               break;
-       case EOsmo4OptXMLProgressive:
-       {
-               const char *opt = gf_cfg_get_key(iAppView->m_user.config, "SAXLoader", "Progressive");
-               Bool use_prog = (opt && !strcmp(opt, "yes")) ? 1 : 0;
-               gf_cfg_set_key(iAppView->m_user.config, "SAXLoader", "Progressive", use_prog ? "no" : "yes");
-               gf_cfg_set_key(iAppView->m_user.config, "SAXLoader", "MaxDuration", "100");
-       }
-               break;
-
-    default:
-               if ((aCommand>=EOsmo4OpenRecentFirst) && (aCommand<=EOsmo4OpenRecentLast)) {
-                       const char *sOpt = gf_cfg_get_key_name(iAppView->m_user.config, "RecentFiles", aCommand - EOsmo4OpenRecentFirst);
-                       if (sOpt) iAppView->Connect(sOpt);
-               } else {
-                       iAppView->MessageBox("Unandled command - panic", "Osmo4");
-                       Panic( EOsmo4Ui );
-               }
-        break;
-    }
-#endif
-}
-
-
-// -----------------------------------------------------------------------------
-//  Called by the framework when the application status pane
-//  size is changed.  Passes the new client rectangle to the
-//  AppView
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppUi::HandleStatusPaneSizeChange()
-{
-       iAppView->SetRect( ClientRect() );
-#ifndef GPAC_GUI_ONLY
-       iPlaylist->SetRect( ClientRect() );
-#endif
-} 
-
-void COsmo4AppUi::TogglePlaylist()
-{
-       CEikButtonGroupContainer* cba= CEikButtonGroupContainer::Current();
-
-#ifndef GPAC_GUI_ONLY
-       switch (view_mode) {
-       case 0:
-               RemoveFromStack(iAppView);
-               iAppView->ShowHide(0);
-               AddToStackL(iPlaylist);
-               if (cba) {
-                       cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_BACK);
-                       cba->DrawDeferred();    
-               }
-               view_was_max = StatusPane()->IsVisible() ? 0 : 1;
-               if (view_was_max) StatusPane()->MakeVisible(ETrue);
-               iPlaylist->ShowHide(1);
-               view_mode = 1;
-               break;
-       case 1:
-               RemoveFromStack(iPlaylist);
-               iPlaylist->ShowHide(0);
-               AddToStackL(iAppView);
-               if (cba) {
-                       cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_EXIT);
-                       cba->DrawDeferred();    
-               }
-               iAppView->ShowHide(1);
-               if (view_was_max) StatusPane()->MakeVisible(EFalse);
-               view_was_max = 0;
-               view_mode = 0;
-               break;
-       }
-#endif
-}
-
-void COsmo4AppUi::PlayURL(const char *url)
-{
-       if (view_mode) {
-               TogglePlaylist();
-       }
-       if (url) {
-               char *sep;
-               iAppView->Connect(url);
-               sep = strrchr(url, '\\');
-               SetTitle(sep ? sep+1 : url);
-       }
-}
-
-void COsmo4AppUi::SetTitleInfo(const char *title)
-{
-#if 1
-    CEikStatusPane* statusPane = StatusPane();
-    CAknTitlePane *iTitlePane = (CAknTitlePane*) statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
-
-       if (!title) title = "Osmo4";
-
-       HBufC *htitle = HBufC::NewL( strlen(title)+1);
-       htitle->Des().Copy( TPtrC8(( TText8* ) title) );
-       iTitlePane->SetText(htitle);
-#endif
-}
-
-void COsmo4AppUi::SetTitle(const char *title, int store_it)
-{
-       if (store_it) {
-               if (m_title) gf_free(m_title);
-               m_title = NULL;
-               if (title) m_title = gf_strdup(title);
-       }
-       SetTitleInfo(title ? title : m_title);
-}
-
-void COsmo4AppUi::SetInfo(const char *info)
-{
-       if (view_mode) return;
-       if (info) {
-               char szTitle[200];
-               sprintf(szTitle, "%s\n%s", info, m_title ? m_title : "Osmo4");
-               SetTitleInfo(szTitle);
-       } else {
-               SetTitleInfo(m_title);
-       }
-}
-
-
-#define DECLARE_MENU_ITEM(__text, __com, __check, __res, has_sep)      \
-               item.iText = __text;    \
-               item.iCommandId = __com;        \
-               item.iFlags = has_sep ? EEikMenuItemSeparatorAfter : 0; \
-               if (__check) item.iFlags |= EEikMenuItemCheckBox | EEikMenuItemSymbolOn; \
-               item.iCascadeId = __res;        \
-               aMenuPane->AddMenuItemL(item);  
-
-
-void COsmo4AppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-{
-       CEikMenuPaneItem::SData item;
-
-       if (aResourceId==R_OSMO4_MENU) {
-        
-               aMenuPane->Reset();
-
-               if (view_mode==1) {
-#ifndef GPAC_GUI_ONLY
-                       Bool is_file = iPlaylist->SelectionIsFile();
-                       Bool in_pl = (is_file && iPlaylist->IsInPlaylist()) ? 1 : 0;
-
-                       if (iPlaylist->PlaylistMode()) {
-                               DECLARE_MENU_ITEM(_L("Up"), EOsmo4PlayListMoveUp, 0, 0, 0);
-                               DECLARE_MENU_ITEM(_L("Down"), EOsmo4PlayListMoveDown, 0, 0, 0);
-                               DECLARE_MENU_ITEM(_L("Remove"), EOsmo4PlayListRem, 0, 0, 0);
-                               DECLARE_MENU_ITEM(_L("Clear"), EOsmo4PlayListClear, 0, 0, 1);
-                       } else if (!in_pl) {
-                               DECLARE_MENU_ITEM(_L("Add to PlayList"), EOsmo4PlayListAdd, 0, 0, 1);
-                       } else if (is_file) {
-                               DECLARE_MENU_ITEM(_L("Remove from Playlist"), EOsmo4PlayListRem, 0, 0, 1);
-                       }
-
-                       if (! iPlaylist->PlaylistMode()) {
-                               DECLARE_MENU_ITEM(iPlaylist->ViewAllFiles() ? _L("View known files") : _L("View all files"), EOsmo4PlayListAllFiles, 0, 0, 1);
-                       } else {
-                               DECLARE_MENU_ITEM(_L("Sort"), 0, 0, R_OSMO4_SM1, 1);
-                       }
-                       DECLARE_MENU_ITEM(iPlaylist->PlaylistMode() ? _L("Browse") : _L("Playlist"), EOsmo4PlayListMode, 0, 0, 0);
-#endif
-               } else {
-                       /*open*/
-                       DECLARE_MENU_ITEM(_L("File"), 0, 0, R_OSMO4_SM1, 0);
-                       DECLARE_MENU_ITEM(_L("View"), 0, 0, R_OSMO4_SM2, 0);
-                       DECLARE_MENU_ITEM(_L("Options"), 0, 0, R_OSMO4_SM3, 0);
-                       //DECLARE_MENU_ITEM(_L("Exit"), EEikCmdExit, 0, 0, 0);
-               }
-               smenu_id = 0;
-               return;
-       } 
-       else if (aResourceId==R_OSMO4_SM1) {
-               aMenuPane->Reset();
-               /*sort menu*/
-               if (view_mode==1) {
-               } 
-               /*file menu*/
-               else {
-                       DECLARE_MENU_ITEM(_L("Open local"), EOsmo4PlayListView, 0, 0, 0);
-                       DECLARE_MENU_ITEM(_L("Open URL"), EOsmo4OpenURL, 0, 0, 1);
-#ifndef GPAC_GUI_ONLY
-                       if (gf_cfg_get_key_name(iAppView->m_user.config, "RecentFiles", 0) != NULL) {
-                               DECLARE_MENU_ITEM(_L("Recent"), 0, 0, R_OSMO4_SSM1, 0);
-                       }
-#endif
-               }
-               smenu_id = 1;
-               return;
-       } 
-       /*not used*/
-       if (view_mode==1) return;
-       
-       /*View menu*/
-       if (aResourceId==R_OSMO4_SM2) {
-               aMenuPane->Reset();
-#ifndef GPAC_GUI_ONLY
-               /*content view menu*/
-               if (gf_term_get_option(iAppView->m_term, GF_OPT_NAVIGATION_TYPE) != GF_NAVIGATE_TYPE_NONE) {
-                       DECLARE_MENU_ITEM(_L("Navigate"), 0, 0, R_OSMO4_SSM1, 1);
-               }
-#endif
-               DECLARE_MENU_ITEM(_L("Fullscreen"), EOsmo4Fullscreen, 0, 0, 0);
-               /*don't allow content AR modification by user*/
-               //DECLARE_MENU_ITEM(_L("Aspect Ratio"), 0, 0, R_OSMO4_SSM2, 1);
-               DECLARE_MENU_ITEM(_L("Maximize size"), EOsmo4ViewMaxSize, (StatusPane()->IsVisible() ? 0 : 1), 0, 1);
-               DECLARE_MENU_ITEM(_L("CPU Usage"), EOsmo4ViewRTI, iAppView->show_rti, 0, 0);
-               smenu_id = 2;
-               return;
-       }
-       /*Option menu*/
-       if (aResourceId==R_OSMO4_SM3) {
-#ifndef GPAC_GUI_ONLY
-               const char *opt = gf_cfg_get_key(iAppView->m_user.config, "Compositor", "ForceOpenGL");
-               DECLARE_MENU_ITEM(_L("Use 2D OpenGL"), EOsmo4OptOpenGL, (opt && !strcmp(opt, "yes")) ? 1 : 0, 0, 0);
-               opt = gf_cfg_get_key(iAppView->m_user.config, "Compositor", "DirectDraw");
-               DECLARE_MENU_ITEM(_L("Direct Draw"), EOsmo4OptDirectDraw, (opt && !strcmp(opt, "yes")) ? 1 : 0, 0, 0);
-               opt = gf_cfg_get_key(iAppView->m_user.config, "SAXLoader", "Progressive");
-               DECLARE_MENU_ITEM(_L("Progressive XML"), EOsmo4OptXMLProgressive, (opt && !strcmp(opt, "yes")) ? 1 : 0, 0, 0);
-
-#endif
-               
-               DECLARE_MENU_ITEM(_L("Enable Logs"), EOsmo4OptEnableLogs, iAppView->do_log, 0, 0);
-               return;
-       }
-       
-       if (aResourceId==R_OSMO4_SSM1) {
-               aMenuPane->Reset();
-               if (smenu_id == 1) {
-                       u32 i = 0;
-#ifndef GPAC_GUI_ONLY
-                       while (1) {
-                               const char *opt = gf_cfg_get_key_name(iAppView->m_user.config, "RecentFiles", i);
-                               if (!opt) break;
-                               const char *sep = strrchr(opt, '\\');
-                               if (!sep) sep = strrchr(opt, '/');
-                               if (!sep) sep = opt;
-                               else sep += 1;
-                               item.iText.Copy( TPtrC8(( TText8* ) sep)  );
-                               item.iCommandId = EOsmo4OpenRecentFirst + i;
-                               item.iFlags = 0; item.iCascadeId = 0;
-                               aMenuPane->AddMenuItemL(item);
-                               i++;
-                               if (i>=10) break;
-                       }
-                       if (!i) {
-                               DECLARE_MENU_ITEM(_L("_"), 0, 0, 0, 0);
-                       }
-#endif
-               } else if (smenu_id == 2) {
-                       DECLARE_MENU_ITEM(_L("Reset"), EOsmo4NavReset, 0, 0, 1);
-                       DECLARE_MENU_ITEM(_L("None"), EOsmo4NavNone, 0, 0, 0);
-                       DECLARE_MENU_ITEM(_L("Slide"), EOsmo4NavSlide, 0, 0, 0);
-
-#ifndef GPAC_GUI_ONLY
-                       if (gf_term_get_option(iAppView->m_term, GF_OPT_NAVIGATION_TYPE) == GF_NAVIGATE_TYPE_3D) {
-                               DECLARE_MENU_ITEM(_L("Walk"), EOsmo4NavWalk, 0, 0, 0);
-                               DECLARE_MENU_ITEM(_L("Fly"), EOsmo4NavFly, 0, 0, 0);
-                               DECLARE_MENU_ITEM(_L("Examine"), EOsmo4NavExamine, 0, 0, 1);
-                               DECLARE_MENU_ITEM(_L("Headlight"), EOsmo4NavHeadlight, 0, 0, 0);
-                               DECLARE_MENU_ITEM(_L("Gravity"), EOsmo4NavGravity, 0, 0, 0);
-                       }
-#endif
-               }
-               return;
-       }
-       
-       if (aResourceId==R_OSMO4_SSM2) {
-               aMenuPane->Reset();
-               DECLARE_MENU_ITEM(_L("Keep Original"), EOsmo4AROriginal, 0, 0, 0);
-               DECLARE_MENU_ITEM(_L("Fill Screen"), EOsmo4ARFillScreen, 0, 0, 0);
-               DECLARE_MENU_ITEM(_L("Ratio 4-3"), EOsmo4AR4_3, 0, 0, 0);
-               DECLARE_MENU_ITEM(_L("Ratio 16-9"), EOsmo4AR16_9, 0, 0, 0);
-               return;
-       }
-}
-
diff --git a/applications/osmo4_sym/osmo4_ui.h b/applications/osmo4_sym/osmo4_ui.h
deleted file mode 100644 (file)
index 06b3578..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) ENST 2006-200X
- *                             Authors: Jean Le Feuvre 
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Symbian GUI player
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- */
-
-#ifndef __OSMO4_UI_H__
-#define __OSMO4_UI_H__
-
-// INCLUDES
-#include <aknappui.h>
-
-
-// FORWARD DECLARATIONS
-class COsmo4AppView;
-class CPlaylist;
-
-
-// osmo4 enumerate command codes
-enum TOsmo4Ids
-{
-       /*Playlist commands*/
-    EOsmo4PlayListView = 0x6001,
-       EOsmo4PlayListAdd,
-       EOsmo4PlayListRem,
-    EOsmo4PlayListMode,
-       EOsmo4PlayListMoveUp,
-       EOsmo4PlayListMoveDown,
-       EOsmo4PlayListClear,
-       EOsmo4PlayListAllFiles,
-       /*file commands*/
-       EOsmo4OpenURL,
-       EOsmo4OpenRecentFirst,
-       EOsmo4OpenRecentLast = EOsmo4OpenRecentFirst + 10,
-       /*view commands*/
-       EOsmo4Fullscreen,
-       EOsmo4ViewMaxSize,
-       EOsmo4AROriginal,
-       EOsmo4ARFillScreen,
-       EOsmo4AR4_3,
-       EOsmo4AR16_9,
-       EOsmo4NavReset,
-       EOsmo4NavNone,
-       EOsmo4NavSlide,
-       EOsmo4NavWalk,
-       EOsmo4NavFly,
-       EOsmo4NavExamine,
-       EOsmo4NavHeadlight,
-       EOsmo4NavGravity,
-       EOsmo4CollideNone,
-       EOsmo4CollideSimple,
-       EOsmo4CollideDisp,
-       EOsmo4ViewRTI,
-
-       /*option commands*/
-    EOsmo4OptEnableLogs,
-    EOsmo4OptOpenGL,
-    EOsmo4OptDirectDraw,
-    EOsmo4OptXMLProgressive,
-
-
-};
-
-
-/** osmo4 application panic codes */
-enum TOsmo4Panics
-{
-    EOsmo4Ui = 1
-    // add further panics here
-};
-
-inline void Panic(TOsmo4Panics aReason)
-{
-    _LIT(applicationName,"Osmo4");
-    User::Panic(applicationName, aReason);
-}
-
-
-#define MAX_KEY_CAP    10
-typedef struct
-{
-       TInt32 key_cap;
-       TInt32 key_cap_ud;
-} KeyCapInfo;
-
-// CLASS DECLARATION
-/**
-* COsmo4AppUi application UI class.
-* Interacts with the user through the UI and request message processing
-* from the handler class
-*/
-class COsmo4AppUi : public CAknAppUi
-    {
-    public: // Constructors and destructor
-
-        /**
-        * ConstructL.
-        * 2nd phase constructor.
-        */
-        void ConstructL();
-
-        /**
-        * COsmo4AppUi.
-        * C++ default constructor. This needs to be public due to
-        * the way the framework constructs the AppUi
-        */
-        COsmo4AppUi();
-
-        /**
-        * ~COsmo4AppUi.
-        * Virtual Destructor.
-        */
-        virtual ~COsmo4AppUi();
-
-    private:  // Functions from base classes
-
-        /**
-        * From CEikAppUi, HandleCommandL.
-        * Takes care of command handling.
-        * @param aCommand Command to be handled.
-        */
-        void HandleCommandL( TInt aCommand );
-
-
-        /**
-        *  HandleStatusPaneSizeChange.
-        *  Called by the framework when the application status pane
-               *  size is changed.
-        */
-
-               void HandleStatusPaneSizeChange();
-               virtual void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
-
-public:
-               void PlayURL(const char *);
-               void SetTitle(const char *title, TBool store_it = ETrue);
-               void SetInfo(const char *);
-
-private:
-               void TogglePlaylist();
-               void SetTitleInfo(const char *);
-               void HandleForegroundEventL(TBool aForeground);
-               void CaptureKeys(int do_capture);
-               void CaptureKey(TInt32 code, TInt32 scancode);
-               
-private:
-        COsmo4AppView* iAppView;
-               CPlaylist *iPlaylist;
-               int view_was_max;
-               int smenu_id;
-               char *m_title;
-               /*current view mode*/
-               int view_mode;
-
-               KeyCapInfo keys[MAX_KEY_CAP];
-               int nb_keys;
-    };
-
-#endif // __OSMO4_UI_H__
-
-// End of File
-
diff --git a/applications/osmo4_sym/osmo4_view.cpp b/applications/osmo4_sym/osmo4_view.cpp
deleted file mode 100644 (file)
index eb1c751..0000000
+++ /dev/null
@@ -1,569 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) ENST 2006-200X
- *                             Authors: Jean Le Feuvre 
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Symbian GUI player
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- */
-
-
-// INCLUDE FILES
-#include <coemain.h>
-#include <eikenv.h>
-
-#include "osmo4_view.h"
-#include "osmo4_ui.h"
-
-#include <gpac/options.h>
-/*for initial setup*/
-#include <gpac/modules/service.h>
-
-
-#if defined(__SERIES60_3X__)
-#define GPAC_CFG_DIR   "\\private\\F01F9075\\"
-#define GPAC_MODULES_DIR       "\\sys\\bin\\"
-#else
-#define GPAC_CFG_DIR   "\\system\\apps\\Osmo4\\"
-#define GPAC_MODULES_DIR       GPAC_CFG_DIR
-#endif
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// Cosmo4AppView::NewL()
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppView* COsmo4AppView::NewL( const TRect& aRect )
-{
-    COsmo4AppView* self = COsmo4AppView::NewLC( aRect );
-    CleanupStack::Pop( self );
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::NewLC()
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppView* COsmo4AppView::NewLC( const TRect& aRect )
-{
-    COsmo4AppView* self = new ( ELeave ) COsmo4AppView;
-    CleanupStack::PushL( self );
-    self->ConstructL( aRect );
-    return self;
-}
-
-
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::COsmo4AppView()
-// C++ default constructor can NOT contain any code, that might leave.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppView::COsmo4AppView()
-{
-    // No implementation required
-       m_pTimer = NULL;
-#ifndef GPAC_GUI_ONLY
-       memset(&m_user, 0, sizeof(GF_User));
-       m_term = NULL;
-       m_mx = NULL;
-       memset(&m_rti, 0, sizeof(GF_SystemRTInfo));
-#endif
-       last_title_update = 0;
-       show_rti = 0;
-#if defined(__SERIES60_3X__)
-       selector = NULL;
-       target = NULL;
-#endif
-}
-
-
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::~COsmo4AppView()
-// Destructor.
-// -----------------------------------------------------------------------------
-//
-COsmo4AppView::~COsmo4AppView()
-{
-       Shutdown();
-#ifndef GPAC_GUI_ONLY
-       if (m_mx) gf_mx_del(m_mx);
-#endif
-
-#if defined(__SERIES60_3X__)
-       if (selector) delete selector;
-       //if (target) delete target;
-#endif
-}
-
-void COsmo4AppView::Shutdown()
-{
-//     MessageBox("Osmo4 shutdown request", "");
-       if (m_pTimer) {
-               m_pTimer->Cancel();
-               delete m_pTimer;
-               m_pTimer = NULL;
-       }
-#ifndef GPAC_GUI_ONLY
-       if (m_term) {
-               GF_Terminal *t = m_term;
-               m_term = NULL;
-               gf_term_del(t);
-       }
-    if (m_user.config) {
-               gf_cfg_del(m_user.config);
-               m_user.config = NULL;
-       }
-       if (m_user.modules) {
-               gf_modules_del(m_user.modules);
-               m_user.modules = NULL;
-       }
-#endif
-//     MessageBox("Osmo4 shutdown OK", "");
-}
-
-void COsmo4AppView::MessageBox(const char *text, const char *title)
-{
-       HBufC *msg1, *msg2;
-       TInt length = User::StringLength( ( TUint8* ) text) + 1;
-       msg1 = HBufC::NewL( length );
-       msg1->Des().Copy( TPtrC8(( TText8* ) text) );
-       
-       length = User::StringLength( ( TUint8* ) title) + 1;
-       msg2 = HBufC::NewL( length );
-       msg2->Des().Copy( TPtrC8(( TText8* ) title) );
-       
-       CEikonEnv::Static()->InfoWinL(*msg2, *msg1);
-       delete msg1;
-       delete msg2;
-}
-
-TInt myTick(TAny* aObject)
-{
-       return ((COsmo4AppView*)aObject)->OnTick();
-}
-
-TInt COsmo4AppView::OnTick()
-{
-#ifndef GPAC_GUI_ONLY
-       if (m_term) gf_term_process_step(m_term);
-
-       /*check RTI display*/
-       if (show_rti && gf_sys_get_rti(500, &m_rti, 0)) DisplayRTI();
-#endif
-       /*never stop...*/
-       return 1;
-}
-
-void COsmo4AppView::DisplayRTI()
-{
-#ifndef GPAC_GUI_ONLY
-       COsmo4AppUi *app = (COsmo4AppUi *) CEikonEnv::Static()->AppUi();
-       char szInfo[20];
-       sprintf(szInfo, "CPU %02d FPS %02.2f", m_rti.process_cpu_usage, gf_term_get_framerate(m_term, 0));
-       app->SetInfo(szInfo);
-#endif
-}
-
-
-//GPAC log function
-static void on_gpac_log(void *cbk, u32 ll, u32 lm, const char *fmt, va_list list)
-{
-       char szMsg[2048];
-       COsmo4AppView *app = (COsmo4AppView *)cbk;
-
-#ifndef GPAC_GUI_ONLY
-       gf_mx_p(app->m_mx);
-       if (app->do_log) {
-               FILE *logs = fopen("\\data\\gpac_logs.txt", "a+t");
-               if (logs) {
-                       vfprintf(logs, fmt, list);
-                       fclose(logs);
-               }
-       } else {
-               vsprintf(szMsg, fmt, list);
-               app->MessageBox(szMsg, "Error:");
-       }
-       gf_mx_v(app->m_mx);
-#endif
-}
-
-static Bool GPAC_EventProc(void *ptr, GF_Event *evt)
-{
-       COsmo4AppView *app = (COsmo4AppView *)ptr;
-       return app->EventProc(evt);
-}
-
-Bool COsmo4AppView::EventProc(GF_Event *evt)
-{
-       TRect r;
-
-#ifndef GPAC_GUI_ONLY
-       switch (evt->type) {
-       case GF_EVENT_MESSAGE:
-               if (!evt->message.message) return 0;
-               if (evt->message.error) {
-                       char err[1024];
-                       sprintf(err, "Error: %s", gf_error_to_string(evt->message.error));
-                       MessageBox(evt->message.message, err);
-               } else {
-                       MessageBox(evt->message.message, "Info");
-               }
-               break;
-       case GF_EVENT_SCENE_SIZE:
-               r = Rect();
-               gf_term_set_size(m_term, r.Width(), r.Height());
-               break;
-       }
-#endif
-       return 0;
-}
-
-void COsmo4AppView::SetupLogs()
-{
-       const char *opt;
-
-#ifndef GPAC_GUI_ONLY
-       gf_mx_p(m_mx);
-       if (do_log) {
-               gf_log_set_level(0);
-               do_log = 0;
-       }
-       /*setup GPAC logs: log all errors*/
-       opt = gf_cfg_get_key(m_user.config, "General", "LogLevel");
-       if ((opt && !stricmp(opt, "debug")) /*|| 1*/) { 
-               FILE *logs = fopen("\\data\\gpac_logs.txt", "wt");
-               if (!logs) {
-                       MessageBox("Cannot open log file - disabling logs", "Warning !");
-               } else {
-                       MessageBox("Debug log enabled in \\data\\gpac_logs.txt", "Info");
-                       fclose(logs);
-                       do_log = 1;
-                       gf_log_set_level(GF_LOG_DEBUG);
-                       u32 lt = gf_log_parse_tools( gf_cfg_get_key(m_user.config, "General", "LogLevel") );
-                       gf_log_set_tools(lt ? lt : 0xFFFFFFFF);
-               }
-       }
-       if (!do_log) {
-               gf_log_set_level(GF_LOG_ERROR);
-               gf_log_set_tools(0xFFFFFFFF);
-       }
-
-       gf_log_set_callback(this, on_gpac_log);
-       gf_mx_v(m_mx);
-
-       GF_LOG(GF_LOG_DEBUG, GF_LOG_CORE, ("Osmo4 logs initialized\n"));
-#endif
-}
-
-
-static void Osmo4_progress_cbk(void *usr, char *title, u32 done, u32 total)
-{
-#ifndef GPAC_GUI_ONLY
-       COsmo4AppView *view = (COsmo4AppView *) usr;
-       COsmo4AppUi *app = (COsmo4AppUi *) CEikonEnv::Static()->AppUi();
-
-       if (done==total) {
-               app->SetInfo(NULL);
-       } else if (view->last_title_update + 500 < gf_sys_clock()) {
-               char szName[1024];
-               view->last_title_update = gf_sys_clock();
-               sprintf(szName, "%s %02d %%", title, (done*100 / total) );
-               app->SetInfo(szName);
-       }
-#endif
-}
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppView::ConstructL( const TRect& aRect )
-{
-       const char *opt;
-       Bool first_launch = 0;
-
-#if defined(__SERIES60_3X__)
-       selector = CRemConInterfaceSelector::NewL();
-       target = CRemConCoreApiTarget::NewL(*selector, *this);
-       selector->OpenTargetL();
-#endif
-
-    // Create a window for this application view
-    CreateWindowL();
-    // Set the windows size
-    SetRect( aRect );
-       //draw
-    ActivateL();
-
-#ifndef GPAC_GUI_ONLY
-       m_window = Window();
-       m_session = CEikonEnv::Static()->WsSession();
-
-       m_mx = gf_mx_new("Osmo4");
-
-       //load config file
-       m_user.config = gf_cfg_init(NULL, &first_launch);
-       if (!m_user.config) {
-               MessageBox("Cannot create GPAC Config file", "Fatal Error");
-               User::Leave(KErrGeneral);
-       }
-       if (first_launch) {
-               MessageBox("Osmo4", "Thank you for Installing");
-       }
-
-       /*load modules*/
-       opt = gf_cfg_get_key(m_user.config, "General", "ModulesDirectory");
-       m_user.modules = gf_modules_new(opt, m_user.config);
-       if (!m_user.modules || !gf_modules_get_count(m_user.modules)) {
-               MessageBox(m_user.modules ? "No modules available" : "Cannot create module manager", "Fatal Error");
-               if (m_user.modules) gf_modules_del(m_user.modules);
-               gf_cfg_del(m_user.config);
-               User::Leave(KErrGeneral);
-       }
-
-       if (first_launch) {
-               /*first launch, register all files ext*/
-               for (u32 i=0; i<gf_modules_get_count(m_user.modules); i++) {
-                       GF_InputService *ifce = (GF_InputService *) gf_modules_load_interface(m_user.modules, i, GF_NET_CLIENT_INTERFACE);
-                       if (!ifce) continue;
-                       if (ifce) {
-                               ifce->CanHandleURL(ifce, "test.test");
-                               gf_modules_close_interface((GF_BaseInterface *)ifce);
-                       }
-               }
-       }
-
-       /*we don't thread the terminal, ie appart from the audio renderer, media decoding and visual rendering is 
-       handled by the app process*/
-       m_user.init_flags = GF_TERM_NO_VISUAL_THREAD | GF_TERM_NO_REGULATION;
-       m_user.EventProc = GPAC_EventProc;
-       m_user.opaque = this;
-       m_user.os_window_handler = (void *) &m_window;
-       m_user.os_display = (void *) &m_session;
-
-       m_term = gf_term_new(&m_user);
-       if (!m_term) {
-               MessageBox("Cannot load GPAC terminal", "Fatal Error");
-               gf_modules_del(m_user.modules);
-               gf_cfg_del(m_user.config);
-               User::Leave(KErrGeneral);
-       }
-       //MessageBox("GPAC terminal loaded", "Success !");
-
-       /*ok set output size*/
-       TSize s = m_window.Size();
-       gf_term_set_size(m_term, s.iWidth, s.iHeight);
-
-
-       /*start our callback (every ms)*/
-       const TInt KTickInterval = 33000;
-       m_pTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-       m_pTimer->Start(KTickInterval, KTickInterval, TCallBack(myTick, this));
-
-       opt = gf_cfg_get_key(m_user.config, "General", "StartupFile");
-       if (opt) gf_term_connect(m_term, opt);
-
-#endif
-
-}
-
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::Draw()
-// Draws the display.
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppView::Draw( const TRect& /*aRect*/ ) const
-{
-#ifndef GPAC_GUI_ONLY
-       if (!m_term) {
-               CWindowGc& gc = SystemGc();
-               TRgb black(0,0,0);
-               gc.SetBrushColor(black);
-               gc.Clear();
-       } else {
-               /*FIXME - this is just to force a screen flush, needs rework*/
-               gf_term_set_option(m_term, GF_OPT_FREEZE_DISPLAY, 0);
-       }
-#else
-               CWindowGc& gc = SystemGc();
-               TRgb black(0,0,0);
-           TRect rect = Rect();
-               gc.SetBrushColor(black);
-               gc.Clear(rect);
-#endif
-}
-
-void COsmo4AppView::ShowHide(Bool show)
-{
-#ifndef GPAC_GUI_ONLY
-       if (show) {
-               MakeVisible(ETrue);
-               if (m_term) {
-                       gf_term_set_option(m_term, GF_OPT_VISIBLE, 1);
-                       DrawDeferred();
-               }
-       } else {
-               MakeVisible(EFalse);
-               if (m_term) gf_term_set_option(m_term, GF_OPT_VISIBLE, 0);
-       }
-#else
-       MakeVisible(ETrue);
-#endif
-}
-
-// -----------------------------------------------------------------------------
-// COsmo4AppView::SizeChanged()
-// Called by framework when the view size is changed.
-// -----------------------------------------------------------------------------
-//
-void COsmo4AppView::SizeChanged()
-{  
-#ifndef GPAC_GUI_ONLY
-       if (m_term) {
-               TSize s = m_window.Size();
-               gf_term_set_size(m_term, s.iWidth, s.iHeight);
-       }
-#endif
-       DrawNow();
-}
-
-void COsmo4AppView::Connect(const char *url)
-{
-#ifndef GPAC_GUI_ONLY
-       char the_url[1024];
-       /*copy before removing from recent files*/
-       strcpy(the_url, url);
-       gf_cfg_set_key(m_user.config, "RecentFiles", the_url, NULL);
-       gf_cfg_insert_key(m_user.config, "RecentFiles", the_url, "", 0);
-       u32 count = gf_cfg_get_key_count(m_user.config, "RecentFiles");
-       if (count > 10) gf_cfg_set_key(m_user.config, "RecentFiles", gf_cfg_get_key_name(m_user.config, "RecentFiles", count-1), NULL);
-
-       if (m_term) gf_term_connect(m_term, the_url);
-#endif
-}
-
-
-TKeyResponse COsmo4AppView::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-{
-       GF_Event evt;
-       u32 ret;
-
-       evt.key.hw_code = aKeyEvent.iScanCode;
-       evt.key.flags = 0;
-       switch (aType) {
-       case EEventKeyUp:
-               evt.type = GF_EVENT_KEYUP;
-               break;
-       case EEventKeyDown:
-       case EEventKey:
-               evt.type = GF_EVENT_KEYDOWN;
-               break;
-       default:
-               return EKeyWasNotConsumed;
-       }
-
-       switch (aKeyEvent.iCode) {
-       case EKeyLeftArrow: evt.key.key_code = GF_KEY_LEFT; break;
-       case EKeyRightArrow: evt.key.key_code = GF_KEY_RIGHT; break;
-       case EKeyUpArrow: evt.key.key_code = GF_KEY_UP; break;
-       case EKeyDownArrow: evt.key.key_code = GF_KEY_DOWN; break;
-       case EKeyIncVolume: evt.key.key_code = GF_KEY_VOLUMEUP; break;
-       case EKeyDecVolume: evt.key.key_code = GF_KEY_VOLUMEDOWN; break;
-       default:
-               switch (aKeyEvent.iScanCode) {
-               case EStdKeyIncVolume: evt.key.key_code = GF_KEY_VOLUMEUP; break;
-               case EStdKeyDecVolume: evt.key.key_code = GF_KEY_VOLUMEDOWN; break;
-               default:
-                       return EKeyWasNotConsumed;
-               }
-       }
-#ifndef GPAC_GUI_ONLY
-       ret = gf_term_user_event(m_term, &evt);
-       /*generate a key up*/
-       if (aType==EEventKey) {
-               evt.type = GF_EVENT_KEYUP;
-               ret += gf_term_user_event(m_term, &evt);
-       }
-#else
-       ret = 0;
-#endif
-       return ret ? EKeyWasConsumed : EKeyWasNotConsumed;
-}
-
-#if defined(__SERIES60_3X__)
-void COsmo4AppView::MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct)
-{
-       GF_Event e;
-       switch (aOperationId) {
-/*
-    TRequestStatus status;
-       case ERemConCoreApiPausePlayFunction:
-       case ERemConCoreApiStop:
-       case ERemConCoreApiRewind:
-       case ERemConCoreApiForward:
-       case ERemConCoreApiFastForward:
-       case ERemConCoreApiBackward:
-               switch (aButtonAct) {
-               case ERemConCoreApiButtonPress:
-                       break;
-               case ERemConCoreApiButtonRelease:
-                       break;
-               case ERemConCoreApiButtonClick:
-                       break;
-               default:
-                       break;
-               }
-*/
-       case ERemConCoreApiVolumeUp:
-       case ERemConCoreApiVolumeDown:
-#ifndef GPAC_GUI_ONLY
-               e.key.hw_code = 0;
-               e.key.flags = 0;
-               e.key.key_code = (aOperationId==ERemConCoreApiVolumeUp) ? GF_KEY_VOLUMEUP : GF_KEY_VOLUMEDOWN;
-               switch (aButtonAct) {
-               case ERemConCoreApiButtonPress: 
-                       e.type = GF_EVENT_KEYDOWN; 
-                       gf_term_user_event(m_term, &e);
-                       break;
-               case ERemConCoreApiButtonRelease: 
-                       e.type = GF_EVENT_KEYUP; 
-                       gf_term_user_event(m_term, &e);
-                       break;
-               default: 
-                       e.type = GF_EVENT_KEYDOWN; 
-                       gf_term_user_event(m_term, &e);
-                       e.type = GF_EVENT_KEYUP; 
-                       gf_term_user_event(m_term, &e);
-                       break;
-               }
-#endif
-               break;
-       default:
-               break;
-       }
-}
-
-#endif
diff --git a/applications/osmo4_sym/osmo4_view.h b/applications/osmo4_sym/osmo4_view.h
deleted file mode 100644 (file)
index c0b3fd1..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) ENST 2006-200X
- *                             Authors: Jean Le Feuvre 
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Symbian GUI player
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- */
-
-
-#ifndef __OSMO4_VIEW_H__
-#define __OSMO4_VIEW_H__
-
-// INCLUDES
-#include <coecntrl.h>
-
-#if defined(__SERIES60_3X__)
-#include <remconcoreapitargetobserver.h>
-#include <remconcoreapitarget.h>
-#include <remconinterfaceselector.h>
-#endif
-
-
-#include <gpac/terminal.h>
-#include <gpac/thread.h>
-
-
-// CLASS DECLARATION
-class COsmo4AppView : public CCoeControl
-#if defined(__SERIES60_3X__)
-               ,MRemConCoreApiTargetObserver
-#endif
-
-    {
-    public: // New methods
-
-        /**
-        * NewL.
-        * Two-phased constructor.
-        * Create a COsmo4AppView object, which will draw itself to aRect.
-        * @param aRect The rectangle this view will be drawn to.
-        * @return a pointer to the created instance of COsmo4AppView.
-        */
-        static COsmo4AppView* NewL( const TRect& aRect );
-
-        /**
-        * NewLC.
-        * Two-phased constructor.
-        * Create a COsmo4AppView object, which will draw itself
-        * to aRect.
-        * @param aRect Rectangle this view will be drawn to.
-        * @return A pointer to the created instance of COsmo4AppView.
-        */
-        static COsmo4AppView* NewLC( const TRect& aRect );
-
-        /**
-        * ~COsmo4AppView
-        * Virtual Destructor.
-        */
-        virtual ~COsmo4AppView();
-
-    public:  // Functions from base classes
-
-        /**
-        * From CCoeControl, Draw
-        * Draw this COsmo4AppView to the screen.
-        * @param aRect the rectangle of this view that needs updating
-        */
-        void Draw( const TRect& aRect ) const;
-
-        /**
-        * From CoeControl, SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        virtual void SizeChanged();
-
-#ifndef GPAC_GUI_ONLY
-               GF_User *GetUser() { return &m_user; }
-#else
-               GF_User *GetUser() { return NULL; }
-#endif
-               void SetupLogs();
-               void MessageBox(const char *text, const char *title);
-
-               virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-
-#if defined(__SERIES60_3X__)
-               void MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct);
-#endif
-
-               TInt OnTick();
-
-               void Shutdown();
-       
-               void Connect(const char *url);
-               void ShowHide(Bool show);
-               Bool EventProc(GF_Event *evt);
-
-#ifndef GPAC_GUI_ONLY
-               GF_Terminal *m_term;
-#endif
-
-    private: // Constructors
-
-        /**
-        * ConstructL
-        * 2nd phase constructor.
-        * Perform the second phase construction of a
-        * COsmo4AppView object.
-        * @param aRect The rectangle this view will be drawn to.
-        */
-        void ConstructL(const TRect& aRect);
-
-               void DisplayRTI();
-
-        /**
-        * COsmo4AppView.
-        * C++ default constructor.
-        */
-        COsmo4AppView();
-
-               CPeriodic *m_pTimer;
-
-               RWindow m_window;
-               RWsSession m_session;
-#ifndef GPAC_GUI_ONLY
-               GF_SystemRTInfo m_rti;
-#endif
-
-#if defined(__SERIES60_3X__)
-               CRemConInterfaceSelector *selector;
-               CRemConCoreApiTarget *target;
-#endif
-
-
-public:
-               u32 last_title_update;
-               Bool do_log;
-               Bool show_rti;
-#ifndef GPAC_GUI_ONLY
-               GF_Mutex *m_mx;
-               GF_User m_user;
-#endif
-    };
-
-
-#endif // __OSMO4_VIEW_H__
-
-// End of File
-
diff --git a/applications/osmo4_sym/playlist.cpp b/applications/osmo4_sym/playlist.cpp
deleted file mode 100644 (file)
index 26c7070..0000000
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) ENST 2006-200X
- *                             Authors: Jean Le Feuvre 
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Symbian GUI player
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- */
-
-#include <eiktxlbx.h>
-#include <eiktxlbm.h>
-
-
-#include <gpac/utf.h>
-
-// INCLUDE FILES
-#include "osmo4_ui.h"
-#include "playlist.h"
-
-#ifdef USE_SKIN
-#include <aknlists.h>
-#include <akntabgrp.h>
-#include <AknsDrawUtils.h>// skin
-#include <AknsBasicBackgroundControlContext.h> //skin 
-#endif
-
-
-CPlaylist::CPlaylist()
-{
-       playlist_mode = 0;
-       view_all_files = 0;
-}
-CPlaylist::~CPlaylist()
-{
-    delete iListBox;
-       delete iBackGround;
-}
-
-CPlaylist* CPlaylist::NewL( const TRect& aRect, GF_User *user)
-{
-    CPlaylist* self = CPlaylist::NewLC( aRect, user);
-    CleanupStack::Pop( self );
-    return self;
-}
-CPlaylist* CPlaylist::NewLC( const TRect& aRect, GF_User *user)
-{
-    CPlaylist* self = new ( ELeave ) CPlaylist;
-    CleanupStack::PushL( self );
-    self->ConstructL( aRect, user);
-    return self;
-}
-
-void CPlaylist::ConstructL(const TRect& aRect, GF_User *user)
-{
-    CreateWindowL();
-
-#ifdef USE_SKIN
-       iListBox = new (ELeave) CAknSingleStyleListBox();
-#else
-       iListBox = new (ELeave) CEikTextListBox();
-#endif
-       iListBox->ConstructL(this);
-       iListBox->SetContainerWindowL(*this);
-       iListBox->SetListBoxObserver(this);
-
-       CDesCArray* textArray = new (ELeave) CDesCArrayFlat(16);
-       iListBox->Model()->SetItemTextArray( textArray );
-    iListBox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-
-    // Creates scrollbar.
-    iListBox->CreateScrollBarFrameL( ETrue );
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto);
-    //iListBox->ActivateL();
-
-       iListBox->SetFocus(ETrue);
-
-    SetRect(aRect);
-    ActivateL();
-       MakeVisible(EFalse);
-
-       strcpy(szCurrentDir, "");
-
-#ifndef GPAC_GUI_ONLY
-       m_user = user;
-
-       strcpy(ext_list, "");
-       u32 count = gf_cfg_get_key_count(user->config, "MimeTypes");
-       for (u32 i=0; i<count; i++) {
-               char szKeyList[1000], *sKey;
-               const char *sMime = gf_cfg_get_key_name(user->config, "MimeTypes", i);
-               const char *opt = gf_cfg_get_key(user->config, "MimeTypes", sMime);
-               strcpy(szKeyList, opt+1);
-               sKey = strrchr(szKeyList, '\"');
-               if (!sKey) continue;
-               sKey[0] = 0;
-               strcat(ext_list, szKeyList);
-               strcat(ext_list, " ");
-       }
-
-       const char *opt = gf_cfg_get_key(m_user->config, "General", "LastWorkingDir");
-       if (opt) strcpy(szCurrentDir, opt);
-#endif
-
-}
-
-void CPlaylist::SizeChanged()
-{
-       iListBox->SetRect( Rect() );
-}
-
-void CPlaylist::Draw(const TRect& aRect) const
-{
-#ifdef USE_SKIN
-    CWindowGc& gc = SystemGc();
-       MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-       MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
-    AknsDrawUtils::Background( skin, cc, this, gc, aRect );
-#endif
-
-}
-
-#ifdef USE_SKIN
-TTypeUid::Ptr CPlaylist::MopSupplyObject(TTypeUid aId)
-{
-       if(aId.iUid == MAknsControlContext::ETypeId && iBackGround) {
-               return MAknsControlContext::SupplyMopObject( aId, iBackGround);
-       }
-       return CCoeControl::MopSupplyObject( aId );
-}
-#endif
-
-
-TInt CPlaylist::CountComponentControls() const
-{
-       return 1;
-}
-CCoeControl* CPlaylist::ComponentControl(TInt aIndex) const
-{
-    switch (aIndex) {
-       case 0: return iListBox;
-       default: return NULL;
-       }
-}
-
-TKeyResponse CPlaylist::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-{
-       if (aType != EEventKey) return iListBox->OfferKeyEventL(aKeyEvent, aType);   
-
-    switch (aKeyEvent.iScanCode) {
-       case EStdKeyEnter:
-               HandleSelection();
-               return EKeyWasConsumed;
-       default:
-               return iListBox->OfferKeyEventL(aKeyEvent, aType);    
-       }
-}
-void CPlaylist::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType )
-{
-    if (aEventType == MEikListBoxObserver::EEventItemClicked ||
-               aEventType == MEikListBoxObserver::EEventEnterKeyPressed)
-
-               HandleSelection();
-}
-
-void CPlaylist::ShowHide(Bool show)
-{
-       if (show) {
-               RefreshPlaylist();
-               MakeVisible(ETrue);
-               DrawNow();
-       } else {
-               /*cleanup*/
-               ResetView();
-               MakeVisible(EFalse);
-               ((COsmo4AppUi *) CEikonEnv::Static()->AppUi())->SetTitle(NULL, 0);
-       }
-}
-
-
-void CPlaylist::FlushItemList()
-{
-       iListBox->HandleItemAdditionL();
-       iListBox->SetCurrentItemIndexAndDraw(0);
-}
-
-void CPlaylist::ResetView()
-{
-       CDesCArray* array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
-       array->Reset();
-       iListBox->Reset();
-}
-
-void CPlaylist::AddItem(const char *name, int is_directory)
-{
-       TBuf<100> tmp;
-       char szName[100];
-       CDesCArray* array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
-
-       if (is_directory) {
-#ifdef USE_SKIN
-               sprintf(szName, "\t+ %s\t\t", name);
-#else
-               sprintf(szName, "+ %s", name);
-#endif
-       } else {
-#ifdef USE_SKIN
-               sprintf(szName, "\t%s\t\t", name);
-#else
-               strcpy(szName, name);
-#endif
-       }
-       tmp.SetLength(strlen(szName)+1);
-       tmp.Copy( TPtrC8(( TText8* ) szName) );
-       tmp.ZeroTerminate();
-       array->AppendL(tmp);
-}
-
-static Bool enum_dirs(void *cbk, char *name, char *path)
-{
-       CPlaylist *of = (CPlaylist *)cbk;
-       of->AddItem(name, 1);
-       return 0;
-}
-
-static Bool enum_files(void *cbk, char *name, char *path)
-{
-       CPlaylist *of = (CPlaylist *)cbk;
-       of->AddItem(name, 0);
-       return 0;
-}
-
-
-void CPlaylist::ScanDirectory(const char *dir)
-{
-       ResetView();
-
-       if (!dir || !strlen(dir)) {
-               RFs iFs;
-               TDriveList aList;
-               iFs.Connect();
-               iFs.DriveList(aList);
-               for (TInt i=0;i<KMaxDrives;i++) {
-                       if (aList[i]) {
-                               TChar aDrive;
-                               iFs.DriveToChar(i, aDrive);
-                               sprintf(szCurrentDir, "%c:", (TUint)aDrive);
-                               AddItem(szCurrentDir, 0);
-                       }
-               }
-               iFs.Close();
-               FlushItemList();
-               strcpy(szCurrentDir, "");
-               return;
-       } else {
-               strcpy(szCurrentDir, dir);
-               AddItem("..", 1);
-       }
-
-#ifndef GPAC_GUI_ONLY
-       gf_enum_directory((const char *) szCurrentDir, 1, enum_dirs, this, NULL);
-       gf_enum_directory((char *) szCurrentDir, 0, enum_files, this, view_all_files ? NULL : ext_list);
-#endif
-       FlushItemList();
-
-       ((COsmo4AppUi *) CEikonEnv::Static()->AppUi())->SetTitle(szCurrentDir, 0);
-
-}
-
-void CPlaylist::GetSelectionName(char *szName)
-{
-       CDesCArray* array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
-       TInt idx = iListBox->CurrentItemIndex();
-
-#ifndef GPAC_GUI_ONLY
-
-#if defined(_UNICODE)
-       size_t len;
-       /*handle terminating zero !!*/
-       u16 szNameUTF16[100];
-       len = (*array)[idx].Size();
-       memcpy(szNameUTF16, (*array)[idx].Ptr(), sizeof(u8)*len);
-       szNameUTF16[len/2] = 0;
-       const u16 *sptr = szNameUTF16;
-
-       /*skip initial '\t'*/
-#ifdef USE_SKIN
-       sptr += 1;
-#endif
-
-       len = gf_utf8_wcstombs(szName, 512, &sptr);
-       szName[len] = 0;
-
-
-#else
-
-       char *src = (*array)[idx]).Ptr();
-       /*skip initial '\t'*/
-#ifdef USE_SKIN
-       src += 1;
-#endif
-       strcpy(szName, (const char *) src) ;
-#endif
-
-       /*remove trailing "\t\t"*/
-#ifdef USE_SKIN
-       len = strlen(szName);
-       szName[len-2] = 0;
-#endif
-
-#else
-       szName[0] = 0;
-#endif
-
-}
-
-void CPlaylist::HandleSelection()
-{
-       char szName[100];
-       GetSelectionName(szName);
-
-       /*sub-directory*/
-       if ((szName[0] == '+') && (szName[1] == ' ')) {
-               /*browse up*/
-               if ((szName[2] == '.') && (szName[3] == '.')) {
-                       char *prev = strrchr(szCurrentDir, '\\');
-                       if (prev) {
-                               prev[0] = 0;
-                               ScanDirectory(szCurrentDir);
-                       } else {
-                               ScanDirectory(NULL);
-                       }
-               } else {
-                       strcat(szCurrentDir, "\\");
-                       strcat(szCurrentDir, szName+2);
-                       ScanDirectory(szCurrentDir);
-               }
-       } else if (szName[1] == ':') {
-               ScanDirectory(szName);
-       } else {
-               char szURL[1024];
-               COsmo4AppUi *app = (COsmo4AppUi *) CEikonEnv::Static()->AppUi();
-               if (playlist_mode) {
-                       TInt idx = iListBox->CurrentItemIndex();
-#ifndef GPAC_GUI_ONLY
-                       const char *url = gf_cfg_get_key_name(m_user->config, "Playlist", idx);
-                       if (url) app->PlayURL(url);
-#endif
-               } else {
-                       gf_cfg_set_key(m_user->config, "General", "LastWorkingDir", (const char *) szCurrentDir);
-                       sprintf(szURL, "%s\\%s", szCurrentDir, szName);
-                       app->PlayURL(szURL);
-               }
-       }
-}
-
-Bool CPlaylist::SelectionIsFile()
-{
-       char szName[100];
-       GetSelectionName(szName);
-       if ((szName[0] == '+') && (szName[1] == ' ')) return 0;
-       else if (szName[1] == ':') return 0;
-       return 1;
-}
-
-Bool CPlaylist::IsInPlaylist()
-{
-       char szURL[1024];
-       char szName[100];
-       GetSelectionName(szName);
-       if ((szName[0] == '+') && (szName[1] == ' ')) return 0;
-       else if (szName[1] == ':') return 0;
-
-       /*remove from playlist*/
-       sprintf(szURL, "%s\\%s", szCurrentDir, szName);
-#ifndef GPAC_GUI_ONLY
-       const char *opt = gf_cfg_get_key(m_user->config, "Playlist", szURL);
-       if (opt) return 1;
-#endif
-       return 0;
-}
-
-static Bool dir_add_files(void *cbk, char *name, char *path)
-{
-       CPlaylist *pl = (CPlaylist *)cbk;
-
-#if 0
-       if (!bViewUnknownTypes && extension_list) {
-               char *ext = strrchr(name, '.');
-               if (!ext || !strstr(extension_list, ext+1)) return 0;
-       }
-#endif
-
-#ifndef GPAC_GUI_ONLY
-       gf_cfg_set_key(pl->m_user->config, "Playlist", path, "");
-#endif
-
-       return 0;
-}
-
-
-void CPlaylist::RefreshPlaylist()
-{
-       if (playlist_mode) {
-#ifndef GPAC_GUI_ONLY
-               u32 count = gf_cfg_get_key_count(m_user->config, "Playlist");
-               ResetView();
-               for (u32 i=0; i<count; i++) {
-                       const char *opt = gf_cfg_get_key_name(m_user->config, "Playlist", i);
-                       const char *sep = strrchr(opt, '\\');
-                       if (!sep) sep = strrchr(opt, '/');
-                       AddItem(sep ? (sep+1) : opt, 0);
-               }
-               if (!count) AddItem("[empty]", 0);
-#endif
-               FlushItemList();
-
-               ((COsmo4AppUi *) CEikonEnv::Static()->AppUi())->SetTitle("Playlist", 0);
-       } else {
-               ScanDirectory(szCurrentDir);
-       }
-}
-
-
-void CPlaylist::PlaylistAct(Osmo4_PLActions act)
-{
-       char szURL[1024];
-       char szName[100];
-       CDesCArray*array;
-       TInt idx;
-       TInt count;
-
-       if (act==Osmo4PLClear) {
-               while (1) {
-#ifndef GPAC_GUI_ONLY
-                       const char *opt = gf_cfg_get_key_name(m_user->config, "Playlist", 0);
-                       if (!opt) break;
-                       gf_cfg_set_key(m_user->config, "Playlist", opt, NULL);
-#endif
-               }
-               RefreshPlaylist();
-               return;
-       } else if (act == Osmo4PLToggleMode) {
-               playlist_mode = !playlist_mode;
-               RefreshPlaylist();
-               return;
-       } else if (act == Osmo4PLToggleAllFiles) {
-               view_all_files = !view_all_files;
-               RefreshPlaylist();
-               return;
-       } else if (act == Osmo4PLAdd) {
-#ifndef GPAC_GUI_ONLY
-               GetSelectionName(szName);
-               if ((szName[0] == '+') && (szName[1] == ' ')) {
-                       if ((szName[2] != '.') && (szName[3] != '.')) {
-                               sprintf(szURL, "%s\\%s", szCurrentDir, szName+2);
-                               gf_enum_directory(szURL, 0, dir_add_files, this, view_all_files ? NULL : ext_list);
-                       }
-               } else if (szName[1] == ':') {
-                       gf_enum_directory(szName, 0, dir_add_files, this, view_all_files ? NULL : ext_list);
-               } else {
-                       sprintf(szURL, "%s\\%s", szCurrentDir, szName);
-                       gf_cfg_set_key(m_user->config, "Playlist", szURL, "");
-               }
-#endif
-               return;
-       }
-
-       GetSelectionName(szName);
-       if ((szName[0] == '+') && (szName[1] == ' ')) return;
-       else if (szName[1] == ':') return;
-
-       switch (act) {
-       /*remove from playlist*/
-       case Osmo4PLRem:
-#ifndef GPAC_GUI_ONLY
-               sprintf(szURL, "%s\\%s", szCurrentDir, szName);
-               gf_cfg_set_key(m_user->config, "Playlist", szURL, NULL);
-#endif
-               RefreshPlaylist();
-               break;
-       /*move up*/
-       case Osmo4PLMoveUp:
-               array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
-               count = array->Count();
-               idx = iListBox->CurrentItemIndex();
-               sprintf(szURL, "%s\\%s", szCurrentDir, szName);
-#ifndef GPAC_GUI_ONLY
-               gf_cfg_set_key(m_user->config, "Playlist", szURL, NULL);
-               gf_cfg_insert_key(m_user->config, "Playlist", szURL, "", idx-1);
-#endif
-               RefreshPlaylist();
-               if (idx>1) iListBox->SetCurrentItemIndexAndDraw(idx-1);
-               break;
-       /*move down*/
-       case Osmo4PLMoveDown:
-               array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
-               count = array->Count();
-               idx = iListBox->CurrentItemIndex();
-               sprintf(szURL, "%s\\%s", szCurrentDir, szName);
-#ifndef GPAC_GUI_ONLY
-               gf_cfg_set_key(m_user->config, "Playlist", szURL, NULL);
-               gf_cfg_insert_key(m_user->config, "Playlist", szURL, "", idx+1);
-#endif
-               RefreshPlaylist();
-               if (idx<count-1) iListBox->SetCurrentItemIndexAndDraw(idx+1);
-               break;
-       default:
-               break;
-       }
-}
-
diff --git a/applications/osmo4_sym/playlist.h b/applications/osmo4_sym/playlist.h
deleted file mode 100644 (file)
index 6e34852..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) ENST 2006-200X
- *                             Authors: Jean Le Feuvre 
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Symbian GUI player
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- */
-
-#ifndef __osmo4playlist_H__
-#define __osmo4playlist_H__
-
-#include <e32base.h>
-#include <coecntrl.h>
-#include <eiklbo.h>
-
-#define USE_SKIN
-
-#ifdef USE_SKIN
-class MAknsControlContext; // for skins support
-#endif
-
-
-#include <gpac/user.h>
-
-class CEikTextListBox; //For list box
-
-enum Osmo4_PLActions
-{
-       Osmo4PLAdd = 0,
-       Osmo4PLRem,
-       Osmo4PLClear,
-       Osmo4PLMoveUp,
-       Osmo4PLMoveDown,
-       Osmo4PLToggleMode,
-       Osmo4PLToggleAllFiles,
-};
-
-class CPlaylist : public CCoeControl,MEikListBoxObserver
-{
-public:
-       static CPlaylist* NewL( const TRect& aRect, GF_User *user);
-       static CPlaylist* NewLC( const TRect& aRect, GF_User *user);
-       virtual ~CPlaylist();
-       void SizeChanged();
-
-       virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-
-       void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType );
-
-       void AddItem(const char *name, int is_directory);
-       TInt CountComponentControls() const;
-       CCoeControl* ComponentControl(TInt aIndex) const;
-       void Draw(const TRect& aRect) const;
-       
-       void ShowHide(Bool show);
-       Bool SelectionIsFile();
-       Bool IsInPlaylist();
-       Bool PlaylistMode() { return playlist_mode; }
-       Bool ViewAllFiles() { return view_all_files; }
-
-       void PlaylistAct(Osmo4_PLActions act);
-
-#ifndef GPAC_GUI_ONLY
-       GF_User *m_user;
-#endif
-
-private:
-    void ConstructL(const TRect& aRect, GF_User *user);
-    CPlaylist();
-
-
-#ifdef USE_SKIN
-       TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
-       MAknsControlContext* iBackGround;
-#endif
-
-
-       void ResetView();
-       void FlushItemList();
-       void ScanDirectory(const char *dir);
-       void HandleSelection();
-       void GetSelectionName(char *name);
-       void RefreshPlaylist();
-
-       char szCurrentDir[1024];        
-       CEikTextListBox* iListBox;
-       Bool playlist_mode;
-       Bool view_all_files;
-       char ext_list[4096];
-};
-
-#endif //__osmo4playlist_H__
-
diff --git a/applications/osmo4_sym/res/osmo4.rss b/applications/osmo4_sym/res/osmo4.rss
deleted file mode 100644 (file)
index b73da36..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <appinfo.rh>
-#include "osmo4_gen.rss"
-
-rls_string STRING_osmo_caption_string "Osmo4"
-
-RESOURCE LOCALISABLE_APP_INFO r_osmo4_localisable_app_info
-     {
-    short_caption = STRING_osmo_caption_string;
-    caption_and_icon = 
-    CAPTION_AND_ICON_INFO
-        {
-        caption = STRING_osmo_caption_string;
-
-        number_of_icons = 1;
-               icon_file = "\\resource\\apps\\osmo4_aif.mif";
-           };
-    }
-
-// End of File
diff --git a/applications/osmo4_sym/res/osmo4.svg b/applications/osmo4_sym/res/osmo4.svg
deleted file mode 100644 (file)
index a8fa8b0..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 88 88">
-<g>
-<g>
-<rect fill="none" width="88" height="88"/>
-</g>
-
-<defs>
-<radialGradient id="grad1" fx="0.45" fy="0.2">
-<stop offset="0" stop-color="rgb(128, 128, 128)"/>
-<stop offset="1" stop-color="black"/>
-</radialGradient>
-<radialGradient id="grad2" fx="0.5" fy="0.5">
-<stop offset="0" stop-color="black"/>
-<stop offset="0.8" stop-color="rgb(128,0,0)"/>
-<stop offset="0.9" stop-color="rgb(255,0,0)"/>
-<stop offset="1" stop-color="rgb(128,0,0)"/>
-</radialGradient>
-</defs>
-
-<g transform="translate(1,1)">
-<circle fill="rgb(128, 128, 128)" cx="44" cy="54" r="20"/> 
-<polygon fill="rgb(128, 128, 128)" points="44 34 64 14 24 14"/> 
-<circle fill="none" stroke-width="8" stroke="rgb(128, 128, 128)" cx="44" cy="44" r="34"/> 
-</g>
-
-<g>
-<circle fill="url(#grad1)" cx="44" cy="54" r="20"/> 
-<polygon fill="black" points="44 34 64 14 24 14"/> 
-<circle fill="none" stroke-width="8" stroke="red" cx="44" cy="44" r="34"/> 
-</g>
-
-</g>
-</svg>
diff --git a/applications/osmo4_sym/res/osmo4_caption.rss b/applications/osmo4_sym/res/osmo4_caption.rss
deleted file mode 100644 (file)
index 6a6a0a0..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Copyright (c) 2004, Nokia. All rights reserved */
-
-
-//  INCLUDES
-#include <apcaptionfile.rh>
-
-
-//  RESOURCE DEFINITIONS
-// -----------------------------------------------------------------------------
-//
-// Caption data for Osmo4
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE CAPTION_DATA
-    {
-    caption="Osmo4";
-    shortcaption= "Osmo4";
-    }
-
-// End of File
diff --git a/applications/osmo4_sym/res/osmo4_gen.rss b/applications/osmo4_sym/res/osmo4_gen.rss
deleted file mode 100644 (file)
index a1cb490..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright (c) 2004, Nokia. All rights reserved */
-
-//  RESOURCE IDENTIFIER
-NAME OSMO    // 4 letter ID
-
-
-//  INCLUDES
-#include <eikon.rh>
-#include <avkon.rh>
-#include <avkon.rsg>
-
-RESOURCE RSS_SIGNATURE
-    {
-    }
-
-RESOURCE TBUF r_default_document_name
-    {
-    buf="OSMO";
-    }
-
-RESOURCE EIK_APP_INFO
-    {
-    menubar = r_Osmo4_menubar;
-    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
-    }
-
-
-RESOURCE MENU_BAR r_Osmo4_menubar
-    {
-    titles =
-        {
-        MENU_TITLE { menu_pane = r_Osmo4_menu; }
-        };
-    }
-
-
-RESOURCE MENU_PANE r_Osmo4_menu
-    {
-    }
-
-RESOURCE MENU_PANE r_osmo4_sm1
-    {
-    }
-
-RESOURCE MENU_PANE r_osmo4_sm2
-    {
-    }
-
-RESOURCE MENU_PANE r_osmo4_sm3
-    {
-    }
-
-RESOURCE MENU_PANE r_osmo4_ssm1
-    {
-    }
-RESOURCE MENU_PANE r_osmo4_ssm2
-    {
-    }
-
diff --git a/applications/osmo4_sym/res/osmo4_reg.rss b/applications/osmo4_sym/res/osmo4_reg.rss
deleted file mode 100644 (file)
index eba4e8a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-* ==============================================================================
-*  Name        : osmo4_reg.rss
-*  Part of     : osmo4
-*  Interface   : 
-*  Description : 
-*  Version     : 
-*
-*  Copyright (c) 2005-2006 Nokia Corporation.
-*  This material, including documentation and any related 
-*  computer programs, is protected by copyright controlled by 
-*  Nokia Corporation.
-* ==============================================================================
-*/
-
-#include <appinfo.rh>
-#include <osmo4.rsg>
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0xF01F9075
-
-RESOURCE APP_REGISTRATION_INFO
-  {
-  app_file="Osmo4";
-  localisable_resource_file =  "\\resource\\apps\\Osmo4";
-  localisable_resource_id = R_OSMO4_LOCALISABLE_APP_INFO;
-
-  embeddability=KAppNotEmbeddable;
-  newfile=KAppDoesNotSupportNewFile;
-  }
-
diff --git a/applications/osmo4_w32/AddressBar.cpp b/applications/osmo4_w32/AddressBar.cpp
deleted file mode 100644 (file)
index 7832fb6..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-// AddressBar.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "osmo4.h"
-#include "MainFrm.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// AddressBar dialog
-
-IMPLEMENT_DYNAMIC(CInitDialogBar, CDialogBar)
-
-BEGIN_MESSAGE_MAP(CInitDialogBar, CDialogBar)
-END_MESSAGE_MAP()
-
-
-CInitDialogBar::CInitDialogBar()
-{
-}
-
-CInitDialogBar::~CInitDialogBar()
-{
-}
-
-BOOL CInitDialogBar::Create(CWnd * pParentWnd, LPCTSTR lpszTemplateName, UINT nStyle, UINT nID)
-{
-       if(!CDialogBar::Create(pParentWnd, lpszTemplateName, nStyle, nID))
-               return FALSE;
-
-       if (!OnInitDialog()) return FALSE;
-
-       return TRUE;
-}
-
-BOOL CInitDialogBar::Create(CWnd * pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID)
-{
-       if(!Create(pParentWnd, MAKEINTRESOURCE(nIDTemplate), nStyle, nID)) return FALSE;
-
-       if(!OnInitDialog()) return FALSE;
-       return TRUE;
-}
-
-
-BOOL CInitDialogBar::OnInitDialog()
-{
-       UpdateData(FALSE);
-       return TRUE;
-}
-
-void CInitDialogBar::DoDataExchange(CDataExchange* pDX)
-{
-       CDialogBar::DoDataExchange(pDX);
-}
-
-
-
-IMPLEMENT_DYNAMIC(AddressBar, CInitDialogBar)
-
-
-BEGIN_MESSAGE_MAP(AddressBar, CInitDialogBar)
-       //{{AFX_MSG_MAP(AddressBar)
-       ON_WM_SIZE()
-       ON_WM_CLOSE()
-       ON_CBN_SELENDOK(IDC_ADDRESS, OnSelendOK)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-AddressBar::AddressBar () : CInitDialogBar()
-{
-}
-
-BOOL AddressBar::OnInitDialog()
-{
-       CInitDialogBar::OnInitDialog();
-       
-       return TRUE;
-}
-
-
-void AddressBar::DoDataExchange(CDataExchange* pDX)
-{
-       CInitDialogBar::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(AddressBar)
-       DDX_Control(pDX, IDC_DUMTXT, m_Title);
-       DDX_Control(pDX, IDC_ADDRESS, m_Address);
-       //}}AFX_DATA_MAP
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// AddressBar message handlers
-
-void AddressBar::OnSize(UINT nType, int cx, int cy) 
-{
-       u32 w;
-       POINT pt;
-       //CDialog::OnSize(nType, cx, cy);
-       
-       if (!m_Address.m_hWnd) return;
-       RECT rc;
-       m_Title.GetClientRect(&rc);
-       w = rc.right - rc.left;
-       m_Address.GetWindowRect(&rc);
-       pt.x = rc.left;
-       pt.y = rc.top;
-       ScreenToClient(&pt);
-       rc.right = cx - pt.x;
-       m_Address.SetWindowPos(this, 0, 0, rc.right, rc.bottom, SWP_NOZORDER | SWP_NOMOVE);
-
-}
-
-void AddressBar::OnClose() 
-{
-}
-
-void AddressBar::ReloadURLs()
-{
-       Osmo4 *gpac = GetApp();
-       u32 i=0;
-
-       while (m_Address.GetCount()) m_Address.DeleteString(0);
-       while (1) {
-               const char *sOpt = gf_cfg_get_key_name(gpac->m_user.config, "RecentFiles", i);
-               if (!sOpt) return;
-               m_Address.AddString(sOpt);
-               i++;
-       }
-}
-
-void AddressBar::SelectionReady() 
-{
-       void UpdateLastFiles(GF_Config *cfg, const char *URL);
-
-       CString URL;
-       int sel = m_Address.GetCurSel();
-       if (sel == CB_ERR) {
-               m_Address.GetWindowText(URL);
-       } else {
-               m_Address.GetLBText(sel, URL);
-       }
-       if (!URL.GetLength()) return;
-       Osmo4 *gpac = GetApp();
-       Playlist *pl = ((CMainFrame*)gpac->m_pMainWnd)->m_pPlayList;
-       /*don't store local files*/
-       if (URL.Find("://", 0)>0) {
-               UpdateLastFiles(gpac->m_user.config, URL);
-               ReloadURLs();
-       }
-       pl->Truncate();
-       pl->QueueURL(URL);
-       pl->RefreshList();
-       pl->PlayNext();
-}
-
-void AddressBar::OnSelendOK() 
-{
-       SelectionReady();
-}
-
-BOOL AddressBar::PreTranslateMessage(MSG* pMsg) 
-{
-       if (pMsg->message == WM_KEYDOWN) {
-               switch (pMsg->wParam) {
-               case VK_RETURN:
-                       ::TranslateMessage(pMsg);
-                       ::DispatchMessage(pMsg);
-                       SelectionReady();
-                       return TRUE;
-               default:
-                       break;
-               }
-       }
-       return CInitDialogBar::PreTranslateMessage(pMsg);
-}
-
diff --git a/applications/osmo4_w32/AddressBar.h b/applications/osmo4_w32/AddressBar.h
deleted file mode 100644 (file)
index 2048fe9..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#if !defined(AFX_ADDRESSBAR_H__B0764C99_5CC2_4412_8B1F_22E71BAD70F0__INCLUDED_)
-#define AFX_ADDRESSBAR_H__B0764C99_5CC2_4412_8B1F_22E71BAD70F0__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// AddressBar.h : header file
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-// AddressBar dialog
-
-class CInitDialogBar : public CDialogBar
-{
-       DECLARE_DYNAMIC(CInitDialogBar)
-
-// Construction
-public:
-       CInitDialogBar(); 
-       virtual ~CInitDialogBar(); 
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CInitDialogBar)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-public:
-       virtual BOOL Create(CWnd * pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID);
-       virtual BOOL Create(CWnd * pParentWnd, LPCTSTR lpszTemplateName, UINT nStyle, UINT nID);
-
-protected:
-       virtual BOOL OnInitDialog();
-
-protected:
-
-       DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// AddressBar dialog
-
-class AddressBar : public CInitDialogBar
-{
-
-       DECLARE_DYNAMIC(AddressBar)
-
-       // Construction
-public:
-       AddressBar(); 
-
-// Dialog Data
-       //{{AFX_DATA(AddressBar)
-       enum { IDD = IDD_NAVBAR };
-       CStatic m_Title;
-       CComboBox       m_Address;
-       //}}AFX_DATA
-
-       void ReloadURLs();
-       void SelectionReady();
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(AddressBar)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       virtual BOOL PreTranslateMessage(MSG* pMsg);
-       //virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(AddressBar)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnSize(UINT nType, int cx, int cy);
-       afx_msg void OnClose();
-       afx_msg void OnSelendOK();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_ADDRESSBAR_H__B0764C99_5CC2_4412_8B1F_22E71BAD70F0__INCLUDED_)
diff --git a/applications/osmo4_w32/FileProps.cpp b/applications/osmo4_w32/FileProps.cpp
deleted file mode 100644 (file)
index a43c234..0000000
+++ /dev/null
@@ -1,712 +0,0 @@
-// FileProps.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "osmo4.h"
-#include "FileProps.h"
-#include "MainFrm.h"
-
-/*ISO 639 languages*/
-#include <gpac/iso639.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CFileProps dialog
-
-
-CFileProps::CFileProps(CWnd* pParent /*=NULL*/)
-       : CDialog(CFileProps::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(CFileProps)
-       //}}AFX_DATA_INIT
-}
-
-
-void CFileProps::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(CFileProps)
-       DDX_Control(pDX, IDC_VIEWSEL, m_ViewSel);
-       DDX_Control(pDX, IDC_ODINFO, m_ODInfo);
-       DDX_Control(pDX, IDC_ODTREE, m_ODTree);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CFileProps, CDialog)
-       //{{AFX_MSG_MAP(CFileProps)
-       ON_NOTIFY(TVN_SELCHANGED, IDC_ODTREE, OnSelchangedOdtree)
-       ON_BN_CLICKED(IDC_WORLD, OnWorld)
-       ON_BN_CLICKED(IDC_VIEWSG, OnViewsg)
-       ON_WM_TIMER()
-       ON_WM_CLOSE()
-       ON_WM_DESTROY()
-       ON_NOTIFY(TCN_SELCHANGE, IDC_VIEWSEL, OnSelchangeViewsel)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CFileProps message handlers
-
-
-#define FP_TIMER_ID    20
-
-BOOL CFileProps::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-
-       char sText[5000];
-       sprintf(sText, "%s Properties", ((CMainFrame*)GetApp()->m_pMainWnd)->m_pPlayList->GetDisplayName());
-       
-       SetWindowText(sText);
-       current_odm = NULL;
-
-       m_ViewSel.InsertItem(0, "General");
-       m_ViewSel.InsertItem(1, "Streams");
-       m_ViewSel.InsertItem(2, "Playback");
-       m_ViewSel.InsertItem(3, "Network");
-
-       m_ODTree.SetIndent(0);
-       RewriteODTree();
-       SetTimer(FP_TIMER_ID, 500, NULL);
-
-       return TRUE;
-}
-
-
-void CFileProps::WriteInlineTree(GF_ObjectManager *root_od, HTREEITEM parent)
-{
-       Osmo4 *gpac = GetApp();
-
-       /*browse all ODs*/
-       u32 count = gf_term_get_object_count(gpac->m_term, root_od);
-
-       for (u32 i=0; i<count; i++) {
-               GF_ObjectManager *odm = gf_term_get_object(gpac->m_term, root_od, i);
-               if (!odm) return;
-               HTREEITEM item = m_ODTree.InsertItem("Object Descriptor", 0, 0, parent);
-               m_ODTree.SetItemData(item, (DWORD) odm);
-               /*if inline propagate*/
-               switch (gf_term_object_subscene_type(gpac->m_term, odm)) {
-               case 1:
-                       m_ODTree.SetItemText(item, "Root Scene");
-                       WriteInlineTree(odm, item);
-                       break;
-               case 2:
-                       m_ODTree.SetItemText(item, "Inline Scene");
-                       WriteInlineTree(odm, item);
-                       break;
-               case 3:
-                       m_ODTree.SetItemText(item, "Extern Proto Lib");
-                       WriteInlineTree(odm, item);
-                       break;
-               default:
-                       break;
-               }
-       }
-}
-
-void CFileProps::RewriteODTree()
-{
-       Osmo4 *gpac = GetApp();
-       
-       m_ODTree.DeleteAllItems();
-
-       GF_ObjectManager *root_odm = gf_term_get_root_object(gpac->m_term);
-       if (!root_odm) return;
-
-       HTREEITEM root = m_ODTree.InsertItem("Root OD", 0, 0);
-       m_ODTree.SetItemData(root, (DWORD) root_odm);
-
-       m_ODTree.SetItemText(root, "Root Scene");
-       WriteInlineTree(root_odm, root);
-}
-
-void CFileProps::OnSelchangedOdtree(NMHDR* pNMHDR, LRESULT* pResult) 
-{
-       NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
-       *pResult = 0;
-       
-       HTREEITEM item = m_ODTree.GetSelectedItem();
-       GF_ObjectManager *odm = (GF_ObjectManager *) m_ODTree.GetItemData(item);
-       if (!odm) return;
-       
-       SetInfo(odm);
-}
-
-
-void CFileProps::OnClose() 
-{
-       KillTimer(FP_TIMER_ID);
-       DestroyWindow();
-}
-
-void CFileProps::OnDestroy() 
-{
-       CDialog::OnDestroy();
-       delete this;
-       ((CMainFrame *)GetApp()->m_pMainWnd)->m_pProps = NULL;
-}
-
-void CFileProps::OnSelchangeViewsel(NMHDR* pNMHDR, LRESULT* pResult) 
-{
-       SetInfo(current_odm);   
-       *pResult = 0;
-}
-
-void CFileProps::SetInfo(GF_ObjectManager *odm)
-{
-       current_odm = odm;
-       switch (m_ViewSel.GetCurSel()) {
-       case 3: SetNetworkInfo(); break;
-       case 2: SetDecoderInfo(); break;
-       case 1: SetStreamsInfo(); break;
-       default: SetGeneralInfo(); break;
-       }
-}
-
-void CFileProps::OnTimer(UINT nIDEvent) 
-{
-       if (nIDEvent == FP_TIMER_ID) {
-               switch (m_ViewSel.GetCurSel()) {
-               case 3: SetNetworkInfo(); break;
-               case 2: SetDecoderInfo(); break;
-               }
-       }
-       
-       CDialog::OnTimer(nIDEvent);
-}
-
-void CFileProps::SetGeneralInfo()
-{
-       char info[10000];
-       char buf[1000];
-       GF_MediaInfo odi;
-       GF_ObjectManager *odm;
-       u32 h, m, s, i, j;
-
-       Osmo4 *gpac = GetApp();
-       odm = current_odm;
-
-       strcpy(info, "");
-       if (!odm || gf_term_get_object_info(gpac->m_term, odm, &odi) != GF_OK) return;
-
-       if (!odi.od) {
-               strcat(info, odi.service_url);
-               m_ODInfo.SetWindowText(info);
-               return;
-       }
-       sprintf(buf, "%sObject Descriptor ID %d\r\n", (odi.has_profiles) ? "Initial " : "", odi.od->objectDescriptorID);
-       strcat(info, buf);
-       if (odi.duration) {
-               h = (u32) (odi.duration / 3600);
-               m = (u32) (odi.duration / 60) - h*60;
-               s = (u32) (odi.duration) - h*3600 - m*60;
-               sprintf(buf, "Duration %02d:%02d:%02d\r\n", h, m, s);
-               strcat(info, buf);
-       } else {
-               strcat(info, "Unknown duration\r\n");
-       }
-       if (odi.owns_service) {
-               strcat(info, "Service Handler: ");
-               strcat(info, odi.service_handler);
-               strcat(info, "\r\n");
-               strcat(info, "Service URL: ");
-               strcat(info, odi.service_url);
-               strcat(info, "\r\n");
-       }
-       
-       if (odi.od->URLString) {
-               strcat(info, "Remote OD - URL: ");
-               strcat(info, odi.od->URLString);
-               strcat(info, "\r\n");
-       } 
-       /*get OD content info*/
-       if (odi.codec_name) {
-               switch (odi.od_type) {
-               case GF_STREAM_VISUAL:
-                       sprintf(buf, "Video Object: Width %d - Height %d\r\n", odi.width, odi.height);
-                       strcat(info, buf);
-                       strcat(info, "Media Codec ");
-                       strcat(info, odi.codec_name);
-                       strcat(info, "\r\n");
-                       if (odi.par) {
-                               sprintf(buf, "Pixel Aspect Ratio: %d:%d\r\n", (odi.par>>16)&0xFF, (odi.par)&0xFF);
-                               strcat(info, buf);
-                       }
-                       break;
-               case GF_STREAM_AUDIO:
-                       sprintf(buf, "Audio Object: Sample Rate %d - %d channels\r\n", odi.sample_rate, odi.num_channels);
-                       strcat(info, buf);
-                       strcat(info, "Media Codec ");
-                       strcat(info, odi.codec_name);
-                       strcat(info, "\r\n");
-                       break;
-               case GF_STREAM_PRIVATE_SCENE:
-               case GF_STREAM_SCENE:
-                       if (odi.width && odi.height) {
-                               sprintf(buf, "Scene Description: Width %d - Height %d\r\n", odi.width, odi.height);
-                       } else {
-                               sprintf(buf, "Scene Description: No size specified\r\n");
-                       }
-                       strcat(info, buf);
-                       strcat(info, "Scene Codec ");
-                       strcat(info, odi.codec_name);
-                       strcat(info, "\r\n");
-                       break;
-               case GF_STREAM_TEXT:
-                       if (odi.width && odi.height) {
-                               sprintf(buf, "Text Object: Width %d - Height %d\r\n", odi.width, odi.height);
-                       } else {
-                               sprintf(buf, "Text Object: No size specified\r\n");
-                       }
-                       strcat(info, buf);
-                       strcat(info, "Text Codec ");
-                       strcat(info, odi.codec_name);
-                       strcat(info, "\r\n");
-                       break;
-               }
-       }
-       if (odi.protection) {
-               strcat(info, "Encrypted Media");
-               if (odi.protection==2) strcat(info, " NOT UNLOCKED");
-               strcat(info, "\r\n");
-       }
-
-       if (!gf_list_count(odi.od->OCIDescriptors)) {
-               m_ODInfo.SetWindowText(info);
-               return;
-       }
-
-       strcat(info, "\r\nObject Content Information:\r\n");
-
-       /*check OCI (not everything interests us) - FIXME: support for unicode*/
-       for (i=0; i<gf_list_count(odi.od->OCIDescriptors); i++) {
-               GF_Descriptor *desc = (GF_Descriptor *) gf_list_get(odi.od->OCIDescriptors, i);
-               switch (desc->tag) {
-               case GF_ODF_SEGMENT_TAG:
-               {
-                       GF_Segment *sd = (GF_Segment *) desc;
-                       strcat(info, "\r\nSegment Descriptor:\r\n");
-                       sprintf(buf, "Name: %s - start time %g sec - duration %g sec\r\n", sd->SegmentName, sd->startTime, sd->Duration);
-                       strcat(info, buf);
-               }
-                       break;
-               case GF_ODF_CC_NAME_TAG:
-               {
-                       GF_CC_Name *ccn = (GF_CC_Name *)desc;
-                       strcat(info, "\r\nContent Creators:\r\n");
-                       for (j=0; j<gf_list_count(ccn->ContentCreators); j++) {
-                               GF_ContentCreatorInfo *ci = (GF_ContentCreatorInfo *) gf_list_get(ccn->ContentCreators, j);
-                               if (!ci->isUTF8) continue;
-                               strcat(info, "\t");
-                               strcat(info, ci->contentCreatorName);
-                               strcat(info, "\r\n");
-                       }
-               }
-                       break;
-
-               case GF_ODF_SHORT_TEXT_TAG:
-                       {
-                               GF_ShortTextual *std = (GF_ShortTextual *)desc;
-                               strcat(info, "\r\n");
-                               strcat(info, std->eventName);
-                               strcat(info, ": ");
-                               strcat(info, std->eventText);
-                               strcat(info, "\r\n");
-                       }
-                       break;
-               /*todo*/
-               case GF_ODF_CC_DATE_TAG:
-                       break;
-               default:
-                       break;
-               }
-
-       }
-
-       m_ODInfo.SetWindowText(info);
-}
-
-void CFileProps::OnWorld() 
-{
-       CString wit;
-       const char *str;
-       GF_List *descs;
-       Osmo4 *gpac = GetApp();
-
-       descs = gf_list_new();
-       str = gf_term_get_world_info(gpac->m_term, current_odm, descs);
-       if (!str) {
-               MessageBox("No World Info available", "Sorry!");
-               return;
-       }
-
-       wit = "";
-       for (u32 i=0; i<gf_list_count(descs); i++) {
-               const char *d = (const char *) gf_list_get(descs, i);
-               wit += d;
-               wit += "\n";
-       }
-       MessageBox(wit, str);
-       gf_list_del(descs);
-}
-
-void CFileProps::OnViewsg() 
-{
-       char szOutRadname[GF_MAX_PATH], *pFilename=NULL;
-       Osmo4 *gpac = GetApp();
-
-       strcpy(szOutRadname, gpac->szUserPath);
-       strcat(szOutRadname, "scene_dump");
-
-       GF_Err e = gf_term_dump_scene(gpac->m_term, (char *) szOutRadname, &pFilename, gpac->m_ViewXMTA, 0, current_odm);
-
-       if (e) {
-               MessageBox(gf_error_to_string(e), "Error while dumping");
-       } else {
-               ShellExecute(NULL, "open", pFilename, NULL, NULL, SW_SHOWNORMAL);
-       }
-       if (pFilename) gf_free(pFilename);
-}
-
-void CFileProps::SetDecoderInfo()
-{
-       GF_MediaInfo odi;
-       char buf[1000], info[2000];
-       u32 h, m, s;
-       Osmo4 *gpac = GetApp();
-
-       sprintf(info, "");
-       m_ODInfo.SetWindowText("");
-
-       if (!current_odm || gf_term_get_object_info(gpac->m_term, current_odm, &odi)) return;
-       if (!odi.od) return;
-
-       strcat(info, "Status: ");
-       switch (odi.status) {
-       case 0:
-       case 1:
-       case 2:
-               h = (u32) (odi.current_time / 3600);
-               m = (u32) (odi.current_time / 60) - h*60;
-               s = (u32) (odi.current_time) - h*3600 - m*60;
-               sprintf(buf, "%s\r\nObject Time: %02d:%02d:%02d\r\n", (odi.status==0) ? "Stopped" : (odi.status==1) ? "Playing" : "Paused", h, m, s);
-               strcat(info, buf);
-               break;
-       case 3:
-               strcat(info, "Not Setup");
-               m_ODInfo.SetWindowText(info);
-               return;
-       default:
-               strcat(info, "Setup Failed");
-               m_ODInfo.SetWindowText(info);
-               return;
-       }
-       /*get clock drift*/
-       sprintf(buf, "Clock drift: %d ms\r\n", odi.clock_drift);
-       strcat(info, buf);
-       /*get buffering*/
-       if (odi.buffer>=0) {
-               sprintf(buf, "Buffering Time: %d ms\r\n", odi.buffer);
-               strcat(info, buf);
-       } else if (odi.buffer==-1) {
-               strcat(info, "Not buffering\r\n");
-       } else {
-               strcat(info, "Not Playing\r\n");
-       }
-       /*get DB occupation*/
-       if (odi.buffer>=0) {
-               sprintf(buf, "Decoding Buffer: %d Access Units\r\n", odi.db_unit_count);
-               strcat(info, buf);
-       }
-       /*get CB occupation*/
-       if (odi.cb_max_count) {
-               sprintf(buf, "Composition Memory: %d/%d Units\r\n", odi.cb_unit_count, odi.cb_max_count);
-               strcat(info, buf);
-       }
-
-       Float avg_dec_time = 0;
-       if (odi.nb_dec_frames) { 
-               avg_dec_time = (Float) odi.total_dec_time; 
-               avg_dec_time /= odi.nb_dec_frames; 
-       }
-       sprintf(buf, "Bitrate over last second: %d kbps\r\nMax bitrate over one second: %d kbps\r\nAverage Decoding Time %.2f ms (%d max)\r\nTotal decoded frames %d - %d dropped\r\n", 
-               (u32) odi.avg_bitrate/1024, odi.max_bitrate/1024, avg_dec_time, odi.max_dec_time, odi.nb_dec_frames, odi.nb_droped);
-       strcat(info, buf);
-
-       m_ODInfo.SetWindowText(info);
-}
-
-
-void CFileProps::SetStreamsInfo()
-{
-       u32 i, count;
-       char info[10000];
-       char buf[1000], code[5];
-       GF_MediaInfo odi;
-       GF_ObjectManager *odm;
-       Bool is_media;
-
-       Osmo4 *gpac = GetApp();
-       odm = current_odm;
-
-       strcpy(info, "");
-       m_ODInfo.SetWindowText("");
-
-       if (!odm || gf_term_get_object_info(gpac->m_term, odm, &odi) != GF_OK) return;
-       if (!odi.od) return;
-
-
-       if (odi.has_profiles) {
-               strcat(info, "MPEG-4 Profiles and Levels:\r\n");
-               sprintf(buf, "\tOD Profile@Level %d\r\n", odi.OD_pl);
-               strcat(info, buf);
-               sprintf(buf, "\tScene Profile@Level %d\r\n", odi.scene_pl);
-               strcat(info, buf);
-               sprintf(buf, "\tGraphics Profile@Level %d\r\n", odi.graphics_pl);
-               strcat(info, buf);
-               sprintf(buf, "\tAudio Profile@Level %d\r\n", odi.audio_pl);
-               strcat(info, buf);
-               sprintf(buf, "\tVisual Profile@Level %d\r\n", odi.visual_pl);
-               strcat(info, buf);
-               sprintf(buf, "\tInline Content Profiled %s\r\n", odi.inline_pl ? "yes" : "no");
-               strcat(info, buf);
-               strcat(info, "\r\n");
-       }
-       is_media = 0;
-       count = gf_list_count(odi.od->ESDescriptors);
-
-       for (i=0; i<count; i++) {
-               GF_ESD *esd = (GF_ESD *) gf_list_get(odi.od->ESDescriptors, i);
-
-               sprintf(buf, "\t** Stream ID %d - Clock ID %d **\r\n", esd->ESID, esd->OCRESID);
-               strcat(info, buf);
-               if (esd->dependsOnESID) {
-                       sprintf(buf, "Depends on Stream ID %d for decoding\r\n", esd->dependsOnESID);
-                       strcat(info, buf);
-               }
-               switch (esd->decoderConfig->streamType) {
-               case GF_STREAM_OD:
-                       sprintf(buf, "OD Stream - version %d\r\n", esd->decoderConfig->objectTypeIndication);
-                       strcat(info, buf);
-                       break;
-               case GF_STREAM_OCR:
-                       sprintf(buf, "OCR Stream\r\n");
-                       strcat(info, buf);
-                       break;
-               case GF_STREAM_SCENE:
-                       sprintf(buf, "Scene Description Stream - version %d\r\n", esd->decoderConfig->objectTypeIndication);
-                       strcat(info, buf);
-                       break;
-               case GF_STREAM_PRIVATE_SCENE:
-                       sprintf(buf, "GPAC Private Scene Description Stream\r\n");
-                       strcat(info, buf);
-                       break;
-               case GF_STREAM_VISUAL:
-                       is_media = 1;
-                       strcat(info, "Visual Stream - media type: ");
-                       switch (esd->decoderConfig->objectTypeIndication) {
-                       case GPAC_OTI_VIDEO_MPEG4_PART2: strcat(info, "MPEG-4\r\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SIMPLE: strcat(info, "MPEG-2 Simple Profile\r\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_MAIN: strcat(info, "MPEG-2 Main Profile\r\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SNR: strcat(info, "MPEG-2 SNR Profile\r\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SPATIAL: strcat(info, "MPEG-2 Spatial Profile\r\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_HIGH: strcat(info, "MPEG-2 High Profile\r\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_422: strcat(info, "MPEG-2 422 Profile\r\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG1: strcat(info, "MPEG-1\r\n"); break;
-                       case GPAC_OTI_IMAGE_JPEG: strcat(info, "JPEG\r\n"); break;
-                       case GPAC_OTI_IMAGE_PNG: strcat(info, "PNG\r\n"); break;
-                       case GPAC_OTI_IMAGE_JPEG_2000: strcat(info, "JPEG2000\r\n"); break;
-                       case GPAC_OTI_MEDIA_GENERIC:
-                               memcpy(code, esd->decoderConfig->decoderSpecificInfo->data, 4);
-                               code[4] = 0;
-                               sprintf(buf, "GPAC Intern (%s)\r\n", code);
-                               strcat(info, buf);
-                               break;
-                       default:
-                               sprintf(buf, "Private/Unknown (0x%x)\r\n", esd->decoderConfig->objectTypeIndication);
-                               strcat(info, buf);
-                               break;
-                       }
-                       break;
-
-               case GF_STREAM_AUDIO:
-                       is_media = 1;
-                       strcat(info, "Audio Stream - media type: ");
-                       switch (esd->decoderConfig->objectTypeIndication) {
-                       case GPAC_OTI_AUDIO_AAC_MPEG4: strcat(info, "MPEG-4\r\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_MP: strcat(info, "MPEG-2 AAC Main Profile\r\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_LCP: strcat(info, "MPEG-2 AAC LowComplexity Profile\r\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_SSRP: strcat(info, "MPEG-2 AAC Scalable Sampling Rate Profile\r\n"); break;
-                       case GPAC_OTI_AUDIO_MPEG2_PART3: strcat(info, "MPEG-2 Audio\r\n"); break;
-                       case GPAC_OTI_AUDIO_MPEG1: strcat(info, "MPEG-1 Audio\r\n"); break;
-                       case GPAC_OTI_AUDIO_EVRC_VOICE: strcat(info, "EVRC Audio\r\n"); break;
-                       case GPAC_OTI_AUDIO_SMV_VOICE: strcat(info, "SMV Audio\r\n"); break;
-                       case GPAC_OTI_AUDIO_13K_VOICE: strcat(info, "QCELP Audio\r\n"); break;
-                       case GPAC_OTI_MEDIA_GENERIC:
-                               memcpy(code, esd->decoderConfig->decoderSpecificInfo->data, 4);
-                               code[4] = 0;
-                               sprintf(buf, "GPAC Intern (%s)\r\n", code);
-                               strcat(info, buf);
-                               break;
-                       default:
-                               sprintf(buf, "Private/Unknown (0x%x)\r\n", esd->decoderConfig->objectTypeIndication);
-                               strcat(info, buf);
-                               break;
-                       }
-                       break;
-               case GF_STREAM_MPEG7:
-                       sprintf(buf, "MPEG-7 Stream - version %d\r\n", esd->decoderConfig->objectTypeIndication);
-                       strcat(info, buf);
-                       break;
-               case GF_STREAM_IPMP:
-                       sprintf(buf, "IPMP Stream - version %d\r\n", esd->decoderConfig->objectTypeIndication);
-                       strcat(info, buf);
-                       break;
-               case GF_STREAM_OCI:
-                       sprintf(buf, "OCI Stream - version %d\r\n", esd->decoderConfig->objectTypeIndication);
-                       strcat(info, buf);
-                       break;
-               case GF_STREAM_MPEGJ:
-                       sprintf(buf, "MPEGJ Stream - version %d\r\n", esd->decoderConfig->objectTypeIndication);
-                       strcat(info, buf);
-                       break;
-               case GF_STREAM_INTERACT:
-                       sprintf(buf, "User Interaction Stream - version %d\r\n", esd->decoderConfig->objectTypeIndication);
-                       strcat(info, buf);
-                       break;
-               case GF_STREAM_TEXT:
-                       sprintf(buf, "3GPP/MPEG-4 Timed Text - version %d\r\n", esd->decoderConfig->objectTypeIndication);
-                       strcat(info, buf);
-                       break;
-               default:
-                       sprintf(buf, "Private/Unknown (StreamType 0x%x OTI 0x%x)\r\n", esd->decoderConfig->streamType, esd->decoderConfig->objectTypeIndication);
-                       strcat(info, buf);
-                       break;
-               }
-
-               sprintf(buf, "Buffer Size %d\r\nAverage Bitrate %d bps\r\nMaximum Bitrate %d bps\r\n", esd->decoderConfig->bufferSizeDB, esd->decoderConfig->avgBitrate, esd->decoderConfig->maxBitrate);
-               strcat(info, buf);
-               if (esd->slConfig->predefined==SLPredef_SkipSL) {
-                       sprintf(buf, "Not using MPEG-4 Synchronization Layer\r\n");
-               } else {
-                       sprintf(buf, "Stream Clock Resolution %d\r\n", esd->slConfig->timestampResolution);
-               }
-               strcat(info, buf);
-               if (esd->URLString) {
-                       sprintf(buf, "Stream Location: %s\r\n", esd->URLString);
-                       strcat(info, buf);
-               }
-
-               /*check language*/
-               if (esd->langDesc) {
-                       u32 i=0;
-                       char lan[4], *szLang;
-                       lan[0] = esd->langDesc->langCode>>16;
-                       lan[1] = (esd->langDesc->langCode>>8)&0xFF;
-                       lan[2] = (esd->langDesc->langCode)&0xFF;
-                       lan[3] = 0;
-
-                       if ((lan[0]=='u') && (lan[1]=='n') && (lan[2]=='d')) szLang = "Undetermined";
-                       else {
-                               szLang = lan;
-                               while (GF_ISO639_Lang[i]) {
-                                       if (GF_ISO639_Lang[i+2][0] && strstr(GF_ISO639_Lang[i+1], lan)) {
-                                               szLang = (char*) GF_ISO639_Lang[i];
-                                               break;
-                                       }
-                                       i+=3;
-                               }
-                       }
-                       sprintf(buf, "Stream Language: %s\r\n", szLang);
-                       strcat(info, buf);
-               }
-               strcat(info, "\r\n");
-       }
-       
-       m_ODInfo.SetWindowText(info);
-}
-
-void CFileProps::SetNetworkInfo()
-{
-       char info[10000];
-       char buf[10000];
-       u32 id;
-       NetStatCommand com;
-       GF_MediaInfo odi;
-       u32 d_enum, nb_streams;
-       GF_Err e;
-       GF_ObjectManager *odm;
-       Osmo4 *gpac = GetApp();
-       odm = current_odm;
-
-       strcpy(info, "");
-       m_ODInfo.SetWindowText("");
-
-       if (!odm || gf_term_get_object_info(gpac->m_term, odm, &odi) != GF_OK) return;
-       if (!odi.od) return;
-
-       if (odi.owns_service) {
-               const char *url, *path;
-               u32 done, total, bps;
-               strcpy(info, "Current Downloads in service:\r\n");
-               d_enum = 0;
-               while (gf_term_get_download_info(gpac->m_term, odm, &d_enum, &url, &path, &done, &total, &bps)) {
-                       if (total && done) {
-                               sprintf(buf, "%s %s: %d / %d bytes (%.2f %%) - %.2f kBps\r\n", url, path, done, total, (100.0f*done)/total, ((Float)bps)/1024);
-                       } else {
-                               sprintf(buf, "%s %s: %.2f kbps\r\n", url, path, ((Float)bps*8)/1024);
-                       }
-                       strcat(info, buf);
-               }
-               if (!d_enum) strcpy(info, "No Downloads in service\r\n");
-               strcat(info, "\r\n");
-       }
-
-       d_enum = 0;
-       nb_streams = 0;
-       while (gf_term_get_channel_net_info(gpac->m_term, odm, &d_enum, &id, &com, &e)) {
-               if (e) continue;
-               if (!com.bw_down && !com.bw_up) continue;
-               nb_streams ++;
-
-               sprintf(buf, "Stream ID %d statistics:\r\n", id);
-               strcat(info, buf);
-               if (com.multiplex_port) {
-                       sprintf(buf, "\tMultiplex Port %d - multiplex ID %d\r\n", com.multiplex_port, com.port);
-               } else {
-                       sprintf(buf, "\tPort %d\r\n", com.port);
-               }
-               strcat(info, buf);
-               sprintf(buf, "\tPacket Loss Percentage: %.4f\r\n", com.pck_loss_percentage);
-               strcat(info, buf);
-               sprintf(buf, "\tDown Bandwidth: %.3f kbps\r\n", ((Float)com.bw_down) / 1024);
-               strcat(info, buf);
-               if (com.bw_up) {
-                       sprintf(buf, "\tUp Bandwidth: %d bps\r\n", com.bw_up);
-                       strcat(info, buf);
-               }
-               if (com.ctrl_port) {
-                       if (com.multiplex_port) {
-                               sprintf(buf, "\tControl Multiplex Port: %d - Control Multiplex ID %d\r\n", com.multiplex_port, com.ctrl_port);
-                       } else {
-                               sprintf(buf, "\tControl Port: %d\r\n", com.ctrl_port);
-                       }
-                       strcat(info, buf);
-                       sprintf(buf, "\tControl Down Bandwidth: %d bps\r\n", com.ctrl_bw_down);
-                       strcat(info, buf);
-                       sprintf(buf, "\tControl Up Bandwidth: %d bps\r\n", com.ctrl_bw_up);
-                       strcat(info, buf);
-               }
-               strcat(info, "\r\n");
-       }
-       if (!nb_streams) strcat(info, "No network streams in this object\r\n");
-
-       m_ODInfo.SetWindowText(info);
-}
diff --git a/applications/osmo4_w32/FileProps.h b/applications/osmo4_w32/FileProps.h
deleted file mode 100644 (file)
index ff0fd27..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#if !defined(AFX_FILEPROPS_H__CA4484B4_0301_4BE1_8736_551250121C3F__INCLUDED_)
-#define AFX_FILEPROPS_H__CA4484B4_0301_4BE1_8736_551250121C3F__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// FileProps.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CFileProps dialog
-
-class CFileProps : public CDialog
-{
-// Construction
-public:
-       CFileProps(CWnd* pParent = NULL);   // standard constructor
-       BOOL Create(CWnd * pParent)
-       {
-               return CDialog::Create( CFileProps::IDD, pParent);
-       }
-
-// Dialog Data
-       //{{AFX_DATA(CFileProps)
-       enum { IDD = IDD_PROPERTIES };
-       CTabCtrl        m_ViewSel;
-       CEdit   m_ODInfo;
-       CTreeCtrl       m_ODTree;
-       //}}AFX_DATA
-
-
-       void RewriteODTree();
-       void WriteInlineTree(GF_ObjectManager *root_od, HTREEITEM parent);
-       void SetInfo(GF_ObjectManager *odm);
-
-private:
-       GF_ObjectManager *current_odm;
-       void SetGeneralInfo();
-       void SetStreamsInfo();
-       void SetDecoderInfo();
-       void SetNetworkInfo();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CFileProps)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(CFileProps)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnSelchangedOdtree(NMHDR* pNMHDR, LRESULT* pResult);
-       afx_msg void OnWorld();
-       afx_msg void OnViewsg();
-       afx_msg void OnTimer(UINT nIDEvent);
-       afx_msg void OnClose();
-       afx_msg void OnDestroy();
-       afx_msg void OnSelchangeViewsel(NMHDR* pNMHDR, LRESULT* pResult);
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_FILEPROPS_H__CA4484B4_0301_4BE1_8736_551250121C3F__INCLUDED_)
diff --git a/applications/osmo4_w32/MainFrm.cpp b/applications/osmo4_w32/MainFrm.cpp
deleted file mode 100644 (file)
index 9f01ec2..0000000
+++ /dev/null
@@ -1,1520 +0,0 @@
-// MainFrm.cpp : implementation of the CMainFrame class
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-
-#include "MainFrm.h"
-#include "resource.h"
-
-#include <gpac/network.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CChildView
-
-CChildView::CChildView()
-{
-}
-
-CChildView::~CChildView()
-{
-       /*since the wndproc is overwritten by the terminal, we detach the handle otherwise we get a nice assertion
-       failure from windows*/
-       HWND hWnd = Detach();
-       ::PostMessage(hWnd, WM_QUIT, 0, 0);
-}
-
-
-BEGIN_MESSAGE_MAP(CChildView,CWnd )
-       //{{AFX_MSG_MAP(CChildView)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CChildView message handlers
-
-BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs) 
-{
-       cs.dwExStyle = 0;
-       cs.style &= ~WS_BORDER;
-
-       cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, 
-               ::LoadCursor(NULL, IDC_ARROW), HBRUSH(COLOR_WINDOW+1), NULL);
-
-       return TRUE;
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame
-
-IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)
-
-BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
-       //{{AFX_MSG_MAP(CMainFrame)
-       ON_WM_CREATE()
-       ON_WM_SETFOCUS()
-       ON_WM_INITMENUPOPUP()
-       ON_WM_SIZE()
-       ON_WM_MOVE()
-       ON_MESSAGE(WM_SETSIZE,OnSetSize)
-       ON_MESSAGE(WM_NAVIGATE,OnNavigate)
-       ON_MESSAGE(WM_OPENURL, Open)
-       ON_MESSAGE(WM_NEWINSTANCE, NewInstanceOpened)
-       
-       ON_WM_LBUTTONDOWN()
-       ON_WM_LBUTTONDBLCLK()
-       ON_WM_LBUTTONUP()
-       ON_WM_CHAR()
-       ON_WM_SYSKEYDOWN()
-       ON_WM_SYSKEYUP()
-       ON_WM_KEYDOWN()
-       ON_WM_KEYUP()
-       ON_WM_DROPFILES()
-       ON_MESSAGE(WM_CONSOLEMSG, OnConsoleMessage)
-       ON_COMMAND(ID_VIEW_ORIGINAL, OnViewOriginal)
-       ON_COMMAND(ID_VIEW_FULLSCREEN, OnViewFullscreen)
-       ON_COMMAND(ID_AR_KEEP, OnArKeep)
-       ON_COMMAND(ID_AR_FILL, OnArFill)
-       ON_COMMAND(ID_AR_43, OnAr43)
-       ON_COMMAND(ID_AR_169, OnAr169)
-       ON_UPDATE_COMMAND_UI(ID_AR_169, OnUpdateAr169)
-       ON_UPDATE_COMMAND_UI(ID_AR_43, OnUpdateAr43)
-       ON_UPDATE_COMMAND_UI(ID_AR_FILL, OnUpdateArFill)
-       ON_UPDATE_COMMAND_UI(ID_AR_KEEP, OnUpdateArKeep)
-       ON_COMMAND(ID_NAVIGATE_NONE, OnNavigateNone)
-       ON_COMMAND(ID_NAVIGATE_WALK, OnNavigateWalk)
-       ON_COMMAND(ID_NAVIGATE_FLY, OnNavigateFly)
-       ON_COMMAND(ID_NAVIGATE_EXAM, OnNavigateExam)
-       ON_COMMAND(ID_NAVIGATE_SLIDE, OnNavigateSlide)
-       ON_COMMAND(ID_NAVIGATE_PAN, OnNavigatePan)
-       ON_COMMAND(ID_NAVIGATE_ORBIT, OnNavigateOrbit)
-       ON_COMMAND(ID_NAVIGATE_GAME, OnNavigateGame)
-       ON_COMMAND(ID_NAVIGATE_VR, OnNavigateVR)
-       ON_COMMAND(ID_NAV_RESET, OnNavigateReset)
-       ON_COMMAND(ID_SHORTCUTS, OnShortcuts)
-       ON_COMMAND(IDD_CONFIGURE, OnConfigure)
-       ON_COMMAND(ID_FILE_PROP, OnFileProp)
-       ON_COMMAND(ID_VIEW_PL, OnViewPlaylist)
-       ON_UPDATE_COMMAND_UI(ID_FILE_PROP, OnUpdateFileProp)
-       ON_UPDATE_COMMAND_UI(ID_NAVIGATE_NONE, OnUpdateNavigate)
-       ON_COMMAND(ID_REC_ENABLE, OnCacheEnable)
-       ON_UPDATE_COMMAND_UI(ID_REC_ENABLE, OnUpdateCacheEnable)
-       ON_COMMAND(ID_REC_STOP, OnCacheStop)
-       ON_COMMAND(ID_REC_ABORT, OnCacheAbort)
-       ON_UPDATE_COMMAND_UI(ID_REC_STOP, OnUpdateCacheStop)
-       ON_COMMAND(ID_COLLIDE_DISP, OnCollideDisp)
-       ON_UPDATE_COMMAND_UI(ID_COLLIDE_DISP, OnUpdateCollideDisp)
-       ON_COMMAND(ID_COLLIDE_NONE, OnCollideNone)
-       ON_UPDATE_COMMAND_UI(ID_COLLIDE_NONE, OnUpdateCollideNone)
-       ON_COMMAND(ID_COLLIDE_REG, OnCollideReg)
-       ON_UPDATE_COMMAND_UI(ID_COLLIDE_REG, OnUpdateCollideReg)
-       ON_COMMAND(ID_HEADLIGHT, OnHeadlight)
-       ON_UPDATE_COMMAND_UI(ID_HEADLIGHT, OnUpdateHeadlight)
-       ON_COMMAND(ID_GRAVITY, OnGravity)
-       ON_UPDATE_COMMAND_UI(ID_GRAVITY, OnUpdateGravity)
-       ON_COMMAND(ID_NAV_INFO, OnNavInfo)
-       ON_COMMAND(ID_NAV_NEXT, OnNavNext)
-       ON_COMMAND(ID_NAV_PREV, OnNavPrev)
-       ON_UPDATE_COMMAND_UI(ID_NAV_NEXT, OnUpdateNavNext)
-       ON_UPDATE_COMMAND_UI(ID_NAV_PREV, OnUpdateNavPrev)
-       ON_COMMAND(ID_CLEAR_NAV, OnClearNav)
-       ON_UPDATE_COMMAND_UI(ID_VIEW_PL, OnUpdateViewPlaylist)
-       ON_COMMAND(ID_PLAYLIST_LOOP, OnPlaylistLoop)
-       ON_UPDATE_COMMAND_UI(ID_PLAYLIST_LOOP, OnUpdatePlaylistLoop)
-       ON_COMMAND(ID_ADD_SUBTITLE, OnAddSubtitle)
-       ON_UPDATE_COMMAND_UI(ID_REC_ABORT, OnUpdateCacheStop)
-       ON_UPDATE_COMMAND_UI(ID_NAVIGATE_WALK, OnUpdateNavigate)
-       ON_UPDATE_COMMAND_UI(ID_NAVIGATE_FLY, OnUpdateNavigate)
-       ON_UPDATE_COMMAND_UI(ID_NAVIGATE_EXAM, OnUpdateNavigate)
-       ON_UPDATE_COMMAND_UI(ID_NAVIGATE_PAN, OnUpdateNavigate)
-       ON_UPDATE_COMMAND_UI(ID_NAVIGATE_SLIDE, OnUpdateNavigate)
-       ON_UPDATE_COMMAND_UI(ID_NAVIGATE_ORBIT, OnUpdateNavigate)
-       ON_UPDATE_COMMAND_UI(ID_NAVIGATE_VR, OnUpdateNavigate)
-       ON_UPDATE_COMMAND_UI(ID_NAVIGATE_GAME, OnUpdateNavigate)
-       ON_COMMAND(ID_FILE_EXIT, OnFileExit)
-       ON_COMMAND(ID_VIEW_CPU, OnViewCPU)
-       ON_UPDATE_COMMAND_UI(ID_VIEW_CPU, OnUpdateViewCPU)
-
-       ON_COMMAND(ID_FILE_COPY, OnFileCopy)
-       ON_UPDATE_COMMAND_UI(ID_FILE_COPY, OnUpdateFileCopy)
-       ON_COMMAND(ID_FILE_PASTE, OnFilePaste)
-       ON_UPDATE_COMMAND_UI(ID_FILE_PASTE, OnUpdateFilePaste)
-       
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame construction/destruction
-
-CMainFrame::CMainFrame()
-{
-       m_icoerror = AfxGetApp()->LoadIcon(IDI_ERR);
-       m_icomessage = AfxGetApp()->LoadIcon(IDI_MESSAGE);
-       m_bFullScreen = m_bRestoreFS = 0;       
-       m_aspect_ratio = GF_ASPECT_RATIO_KEEP;
-       m_pProps = NULL;
-       m_pOpt = NULL;
-       m_pPlayList = NULL;
-       m_pWndView = new CChildView();
-       m_bInitShow = TRUE;
-       m_bStartupFile = TRUE;
-       m_num_chapters = 0;
-       m_chapters_start = NULL;
-       m_last_prog = -1;
-       m_timer_on = 0;
-       m_show_rti = 0;
-       nb_viewpoints = 0;
-}
-
-CMainFrame::~CMainFrame()
-{
-       if (m_chapters_start) gf_free(m_chapters_start);
-       if (m_pProps != NULL) m_pProps->DestroyWindow();
-       if (m_pOpt != NULL) m_pOpt->DestroyWindow();
-       if (m_pPlayList != NULL) delete m_pPlayList;
-       delete m_pWndView;
-}
-
-
-
-
-#define RTI_TIMER      22
-#define RTI_REFRESH_MS         500
-
-void CALLBACK EXPORT RTInfoTimer(HWND , UINT , UINT nID , DWORD )
-{
-       char szMsg[100];
-       GF_SystemRTInfo rti;
-       if (nID != RTI_TIMER) return;
-       Osmo4 *app = GetApp();
-       CMainFrame *pFrame = (CMainFrame *) app->m_pMainWnd;
-       /*shutdown*/
-       if (!pFrame) return;
-
-       if (pFrame->m_show_rti && !pFrame->m_timer_on) {
-               if (!gf_sys_get_rti(RTI_REFRESH_MS, &rti, 0)) return;
-               if (!rti.gpac_memory) rti.gpac_memory = rti.process_memory ? rti.process_memory : rti.physical_memory;
-
-               if (pFrame->m_show_rti && !pFrame->m_timer_on) {
-                       sprintf(szMsg, "FPS %02.2f - CPU %02d (%02d) - Mem %d kB", 
-                                               gf_term_get_framerate(app->m_term, 0), rti.total_cpu_usage, rti.process_cpu_usage, rti.gpac_memory/1024);
-                       pFrame->m_wndStatusBar.SetPaneText(1, szMsg);
-               }
-       }
-
-       u32 ms = gf_term_get_time_in_ms(app->m_term);
-       u32 h = ms / 1000 / 3600;
-       u32 m = ms / 1000 / 60 - h*60;
-       u32 s = ms / 1000 - h*3600 - m*60;
-       
-       sprintf(szMsg, "%02d:%02d.%02d", h, m, s);
-       pFrame->m_wndStatusBar.SetPaneText(0, szMsg);
-}
-
-static UINT status_indics[] =
-{
-       ID_TIMER,
-       ID_SEPARATOR,           // status line indicator
-};
-
-
-
-int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
-       UINT buttonArray[50];
-       TBBUTTONINFO bi;
-       u32 *ba;
-       if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
-               return -1;
-
-       // create a view to occupy the client area of the frame
-       if (!m_pWndView->CreateEx(0, NULL, NULL, WS_CHILD, 0, 0, 300, 200, m_hWnd, NULL, NULL))
-       {
-               TRACE0("Failed to create view window\n");
-               return -1;
-       }
-       m_pPlayList = new Playlist();
-       m_pPlayList->Create();
-       m_pPlayList->ShowWindow(SW_HIDE);
-
-
-       if (!m_wndToolBar.CreateEx(this, WS_CHILD | CBRS_TOP | CBRS_FLYBY) ||
-               !m_wndToolBar.LoadBitmap(IDR_MAINTOOLS))
-       {
-               TRACE0("Failed to create toolbar\n");
-               return -1;      // fail to create
-       }
-
-       ba = &buttonArray[0];
-       *ba = ID_FILEOPEN; ba++;
-       *ba = ID_SEPARATOR; ba++;
-       *ba = ID_NAV_PREV; ba++;
-       *ba = ID_NAV_NEXT; ba++;
-       *ba = ID_SEPARATOR; ba++;
-       *ba = ID_FILE_PLAY; ba++;
-       *ba = ID_FILE_STEP; ba++;
-       *ba = ID_FILE_STOP; ba++;
-       *ba = ID_SEPARATOR; ba++;
-       *ba = ID_FILE_PROP; ba++;
-       *ba = ID_SEPARATOR; ba++;
-       *ba = ID_FILE_PROP; ba++;
-       *ba = ID_SWITCH_RENDER;
-       m_wndToolBar.SetButtons(buttonArray, 13);
-       m_wndToolBar.SetButtonInfo(0, ID_FILEOPEN, TBBS_BUTTON, 0);
-       m_wndToolBar.SetButtonInfo(1, ID_SEPARATOR, TBBS_SEPARATOR, 0);
-       m_wndToolBar.SetButtonInfo(2, ID_NAV_PREV, TBBS_DROPDOWN, 1);
-       m_wndToolBar.SetButtonInfo(3, ID_NAV_NEXT, TBBS_DROPDOWN, 2);
-       m_wndToolBar.SetButtonInfo(4, ID_SEPARATOR, TBBS_SEPARATOR, 0);
-       m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, 3);
-       m_wndToolBar.SetButtonInfo(6, ID_FILE_STEP, TBBS_BUTTON, 5);
-       m_wndToolBar.SetButtonInfo(7, ID_FILE_STOP, TBBS_BUTTON, 6);
-       m_wndToolBar.SetButtonInfo(8, ID_SEPARATOR, TBBS_SEPARATOR, 0);
-       m_wndToolBar.SetButtonInfo(9, ID_FILE_PROP, TBBS_BUTTON, 7);
-       m_wndToolBar.SetButtonInfo(10, ID_SEPARATOR, TBBS_SEPARATOR, 0);
-       m_wndToolBar.SetButtonInfo(11, IDD_CONFIGURE, TBBS_BUTTON, 8);
-       m_wndToolBar.SetButtonInfo(12, ID_SWITCH_RENDER, TBBS_BUTTON, 9);
-
-       CToolBarCtrl &ctrl = m_wndToolBar.GetToolBarCtrl();
-       ctrl.SetStyle(TBSTYLE_FLAT | TBSTYLE_DROPDOWN);
-       ctrl.SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);
-
-       memset(&bi, 0, sizeof(bi));
-       bi.cbSize = sizeof(bi);
-       ctrl.GetButtonInfo(2, &bi);
-       bi.fsStyle |= TBSTYLE_DROPDOWN;
-       ctrl.SetButtonInfo(ID_NAV_PREV, &bi);
-
-       memset(&bi, 0, sizeof(bi));
-       bi.cbSize = sizeof(bi);
-       ctrl.GetButtonInfo(3, &bi);
-       bi.fsStyle |= TBSTYLE_DROPDOWN;
-       ctrl.SetButtonInfo(ID_NAV_NEXT, &bi);
-
-       if (!m_wndStatusBar.Create(this) ||
-               !m_wndStatusBar.SetIndicators(status_indics,
-                 sizeof(status_indics)/sizeof(UINT)))
-       {
-               TRACE0("Failed to create status bar\n");
-               return -1;      // fail to create
-       }
-
-       if (!m_Address.Create(this, IDD_NAVBAR, WS_CHILD | CBRS_TOP | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, IDD_NAVBAR) ) {
-               return -1;      // fail to create
-       }
-
-       if (!m_Sliders.Create(IDD_SLIDERS, this) ) {
-               return -1;      // fail to create
-       }
-
-       m_wndStatusBar.SetPaneInfo(0, ID_TIMER, SBPS_NORMAL, 60);
-       m_wndStatusBar.SetPaneInfo(1, ID_SEPARATOR, SBPS_STRETCH, 0);
-       SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), TRUE);
-       SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE);
-
-       SetTimer(RTI_TIMER, RTI_REFRESH_MS, RTInfoTimer);
-       return 0;
-}
-
-
-BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
-{
-       if( !CFrameWnd::PreCreateWindow(cs) )
-               return FALSE;
-       // TODO: Modify the Window class or styles here by modifying
-       //  the CREATESTRUCT cs
-
-       cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
-       cs.lpszClass = AfxRegisterWndClass(0);
-       return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame diagnostics
-
-#ifdef _DEBUG
-void CMainFrame::AssertValid() const
-{
-       CFrameWnd::AssertValid();
-}
-
-void CMainFrame::Dump(CDumpContext& dc) const
-{
-       CFrameWnd::Dump(dc);
-}
-
-#endif //_DEBUG
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame message handlers
-void CMainFrame::OnSetFocus(CWnd* pOldWnd)
-{
-       m_pWndView->SetFocus();
-       if (m_bRestoreFS==1) {
-               m_bRestoreFS=2;
-       }
-       else if (m_bRestoreFS==2) {
-               m_bRestoreFS = 0;
-               SetFullscreen();
-       }
-}
-
-BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
-{
-       // let the view have first crack at the command
-       if (m_pWndView->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
-               return TRUE;
-
-       // otherwise, do default handling
-       return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
-}
-
-
-void CMainFrame::OnSize(UINT nType, int cx, int cy) 
-{
-       RECT rc2;
-       u32 tool_h, slide_h, add_h, stat_h;
-
-       if (m_bInitShow) {
-               CFrameWnd::OnSize(nType, cx, cy);
-               return;
-       }
-       m_wndToolBar.GetClientRect(&rc2);
-       tool_h = rc2.bottom - rc2.top;
-       m_Address.GetClientRect(&rc2);
-       add_h = rc2.bottom - rc2.top;
-       m_Sliders.GetClientRect(&rc2);
-       slide_h = rc2.bottom - rc2.top;
-       m_wndStatusBar.GetClientRect(&rc2);
-       stat_h = rc2.bottom - rc2.top;
-       if ((u32) cy <= tool_h+add_h+slide_h+stat_h) {
-               OnSetSize(cx, 1);
-               return;
-       }
-
-       CFrameWnd::OnSize(nType, cx, cy);
-       cy -= tool_h + add_h + slide_h + stat_h;
-
-       m_Address.SetWindowPos(this, 0, 0, cx, add_h, SWP_SHOWWINDOW | SWP_NOMOVE);
-
-       m_pWndView->ShowWindow(SW_SHOW);
-       m_pWndView->SetWindowPos(this, 0, add_h + tool_h, cx, cy, SWP_NOZORDER);
-
-       m_Sliders.SetWindowPos(this, 0, add_h + tool_h + cy, cx, slide_h, SWP_NOZORDER|SWP_SHOWWINDOW);
-       /*and resize term*/
-       gf_term_set_size(GetApp()->m_term, cx, cy);
-}
-
-
-LONG CMainFrame::OnSetSize(WPARAM wParam, LPARAM lParam)
-{
-       UINT width, height;
-       width = wParam;
-       height = lParam;
-       if (m_bInitShow) {
-               m_wndToolBar.UpdateWindow();
-               m_wndToolBar.ShowWindow(SW_SHOW);
-               m_Address.UpdateWindow();
-               m_Address.ShowWindow(SW_SHOW);
-               m_Sliders.UpdateWindow();
-               m_Sliders.ShowWindow(SW_SHOW);
-               m_Sliders.m_PosSlider.EnableWindow(FALSE);
-               m_pWndView->ShowWindow(SW_SHOW);
-               ShowWindow(SW_SHOW);
-               m_bInitShow = FALSE;
-       }
-
-       RECT winRect;
-       winRect.left = 0;
-       winRect.right = width;
-       winRect.top = 0;
-       winRect.bottom = height;
-       AdjustWindowRectEx(&winRect, GetStyle(), TRUE, GetExStyle());
-       winRect.bottom -= winRect.top;
-       winRect.right -= winRect.left;
-       winRect.left = winRect.top = 0;
-
-       RECT rc2;
-       m_Address.GetClientRect(&rc2);
-       winRect.bottom += rc2.bottom;
-       m_wndToolBar.GetClientRect(&rc2);
-       winRect.bottom += rc2.bottom;
-       m_Sliders.GetClientRect(&rc2);
-       winRect.bottom += rc2.bottom;
-       m_wndStatusBar.GetClientRect(&rc2);
-       winRect.bottom += rc2.bottom;
-
-       GetWindowRect(&rc2);
-       rc2.bottom -= rc2.top;
-       rc2.right -= rc2.left;
-       if ((rc2.right != winRect.right) || (rc2.bottom != winRect.bottom)) {
-               SetWindowPos(NULL, 0, 0, winRect.right, winRect.bottom, SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW);
-       } else {
-               /*just resize term*/
-               //gf_term_set_size(GetApp()->m_term, width, height);
-               SetWindowPos(NULL, 0, 0, winRect.right, winRect.bottom, SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW);
-       }
-       return 0;
-}
-
-void CMainFrame::OnMove(int x, int y) 
-{
-       CFrameWnd::OnMove(x, y);
-       RECT rc;
-       
-       m_wndToolBar.GetClientRect(&rc);
-       m_wndToolBar.SetWindowPos(this, x, y, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
-       y += rc.bottom - rc.top;
-       m_Address.SetWindowPos(this, x, y, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
-       m_Address.GetClientRect(&rc);
-       y += rc.bottom - rc.top;
-       m_pWndView->SetWindowPos(this, x, y, 0, 0, SWP_NOSIZE);
-       m_pWndView->GetClientRect(&rc);
-       y += rc.bottom;
-       m_Sliders.SetWindowPos(this, x, y, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
-}
-
-
-#define PROGRESS_TIMER 20
-#define PROGRESS_REFRESH_MS            100
-
-void CALLBACK EXPORT ProgressTimer(HWND , UINT , UINT nID , DWORD )
-{
-       u32 now;
-       if (nID != PROGRESS_TIMER) return;
-       Osmo4 *app = GetApp();
-       CMainFrame *pFrame = (CMainFrame *) app->m_pMainWnd;
-       /*shutdown*/
-       if (!pFrame) return;
-
-       now = gf_term_get_time_in_ms(app->m_term);
-       if (!now) return;
-
-       if (app->can_seek && !pFrame->m_Sliders.m_grabbed) {
-               if (now >= app->max_duration + 100) {
-                       if (gf_term_get_option(app->m_term, GF_OPT_IS_FINISHED)) {
-                               pFrame->m_pPlayList->PlayNext();
-               }
-                       /*if no IsOver go on forever*/
-               } else {
-                       if (!app->m_reset)
-                               pFrame->m_Sliders.m_PosSlider.SetPos(now);
-               }
-       }
-}
-
-void CMainFrame::SetProgTimer(Bool bOn) 
-{
-       if (bOn) 
-               SetTimer(PROGRESS_TIMER, PROGRESS_REFRESH_MS, ProgressTimer); 
-       else
-               KillTimer(PROGRESS_TIMER);
-}
-
-
-LONG CMainFrame::Open(WPARAM wParam, LPARAM lParam)
-{
-       Bool do_pause;
-       Osmo4 *app = GetApp();
-       CString txt, url;
-       m_bStartupFile = FALSE;
-       txt = "Osmo4 - ";
-       txt += m_pPlayList->GetDisplayName();
-
-       url = m_pPlayList->GetURL();
-       m_Address.m_Address.SetWindowText(url);
-       SetWindowText(txt);
-       if (app->start_mode==1) do_pause = 1;
-       else if (app->start_mode==2) do_pause = 0;
-       else do_pause = /*!app->m_AutoPlay*/0;
-       gf_term_connect_from_time(app->m_term, (LPCSTR) url, app->m_reconnect_time, do_pause);
-       app->m_reconnect_time = 0;
-       app->start_mode = 0;
-       app->UpdatePlayButton();
-       nb_viewpoints = 0;
-       return 1;       
-}
-
-LONG CMainFrame::NewInstanceOpened(WPARAM wParam, LPARAM lParam)
-{
-       Bool queue_only = 0;
-       char *url = (char *) static_gpac_get_url();
-       if (!strnicmp(url, "-queue ", 7)) {
-               queue_only = 1;
-               url += 7;
-       }
-       m_pPlayList->QueueURL(url);
-       m_pPlayList->RefreshList();
-       if (!queue_only) m_pPlayList->PlayNext();
-       return 1;
-}
-
-
-void CMainFrame::ForwardMessage()
-{
-       const MSG *msg = GetCurrentMessage();
-       m_pWndView->SendMessage(msg->message, msg->wParam, msg->lParam);
-}
-void CMainFrame::OnSysKeyUp(UINT , UINT , UINT ) { ForwardMessage(); }
-void CMainFrame::OnSysKeyDown(UINT , UINT , UINT ) { ForwardMessage(); }
-void CMainFrame::OnChar(UINT , UINT , UINT ) { ForwardMessage(); }
-void CMainFrame::OnKeyDown(UINT , UINT , UINT ) { ForwardMessage(); }
-void CMainFrame::OnKeyUp(UINT , UINT , UINT ) { ForwardMessage(); }
-void CMainFrame::OnLButtonDown(UINT , CPoint ) { ForwardMessage(); }
-void CMainFrame::OnLButtonDblClk(UINT , CPoint ) { ForwardMessage(); }
-void CMainFrame::OnLButtonUp(UINT , CPoint ) { ForwardMessage(); }
-
-void CMainFrame::OnDropFiles(HDROP hDropInfo) 
-{
-       u32 i, count;
-       Osmo4 *app = GetApp();
-       char fileName[MAX_PATH];
-
-       count = ::DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0);
-       if (!count) return;
-
-       /*if playing and sub d&d, open sub in current presentation*/
-       if (app->m_isopen && (count==1)) {
-               ::DragQueryFile(hDropInfo, 0, fileName, MAX_PATH);
-               char *ext = strrchr(fileName, '.');
-               if (ext && ( !stricmp(ext, ".srt") || !stricmp(ext, ".sub") || !stricmp(ext, ".ttxt") || !stricmp(ext, ".xml") ) ) {
-                       AddSubtitle(fileName, 1);
-                       return;
-               }
-       }
-       
-/*     if (count==1) 
-               m_pPlayList->Truncate();
-       else
-*/             m_pPlayList->Clear();
-
-       for (i=0; i<count; i++) {
-               ::DragQueryFile (hDropInfo, i, fileName, MAX_PATH);
-               m_pPlayList->QueueURL(fileName);
-       }
-       m_pPlayList->RefreshList();
-       m_pPlayList->PlayNext();
-}
-
-void CALLBACK EXPORT ConsoleTimer(HWND , UINT , UINT , DWORD )
-{
-       CMainFrame *pFrame = (CMainFrame *) GetApp()->m_pMainWnd;
-       
-       pFrame->m_wndStatusBar.GetStatusBarCtrl().SetIcon(2, NULL);
-       pFrame->KillTimer(pFrame->m_timer_on);
-       pFrame->m_timer_on = 0;
-       pFrame->m_wndStatusBar.SetPaneText(1, "Ready");
-}
-
-#define CONSOLE_DISPLAY_TIME   1000
-
-LONG CMainFrame::OnConsoleMessage(WPARAM wParam, LPARAM lParam)
-{
-       if (m_timer_on) KillTimer(m_timer_on);
-       
-       if (console_err>=0) {
-               m_wndStatusBar.GetStatusBarCtrl().SetIcon(2, m_icomessage);
-               m_wndStatusBar.SetPaneText(1, console_message);
-       } else {
-               char msg[5000];
-               m_wndStatusBar.GetStatusBarCtrl().SetIcon(2, m_icoerror);
-               sprintf(msg, "%s (%s)", console_message, console_service);
-               m_wndStatusBar.SetPaneText(1, msg);
-       }
-       m_timer_on = SetTimer(10, wParam ? wParam : CONSOLE_DISPLAY_TIME, ConsoleTimer);
-       return 0;
-}
-
-BOOL CMainFrame::DestroyWindow() 
-{
-       if (GetApp()->m_isopen) KillTimer(PROGRESS_TIMER);
-       /*signal close to prevent callbacks but don't close, this is done in ExitInstance (otherwise there's a
-       deadlock happening not sure why yet)*/
-//     GetApp()->m_open = 0;
-       return CFrameWnd::DestroyWindow();
-}
-
-
-void CMainFrame::OnViewOriginal() 
-{
-       Osmo4 *gpac = GetApp();
-       gf_term_set_option(gpac->m_term, GF_OPT_ORIGINAL_VIEW, 1);      
-       OnSetSize(gpac->orig_width, gpac->orig_height);
-}
-
-void CMainFrame::SetFullscreen() 
-{
-       Osmo4 *gpac = GetApp();
-       if (!m_bFullScreen) {
-//             GetWindowRect(&backup_wnd_rc);
-               if (gf_term_set_option(gpac->m_term, GF_OPT_FULLSCREEN, 1) == GF_OK) 
-                       m_bFullScreen = 1;
-       } else {
-               if (gf_term_set_option(gpac->m_term, GF_OPT_FULLSCREEN, 0) == GF_OK) 
-                       m_bFullScreen = 0;
-//             SetWindowPos(NULL, backup_wnd_rc.left, backup_wnd_rc.top, backup_wnd_rc.right-backup_wnd_rc.left, backup_wnd_rc.bottom-backup_wnd_rc.top, SWP_NOZORDER);
-       }
-}
-
-void CMainFrame::OnViewFullscreen() 
-{
-       SetFullscreen();
-}
-
-void CMainFrame::OnArKeep() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);        
-       m_aspect_ratio = GF_ASPECT_RATIO_KEEP;
-}
-
-void CMainFrame::OnArFill() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN); 
-       m_aspect_ratio = GF_ASPECT_RATIO_FILL_SCREEN;
-}
-
-void CMainFrame::OnAr43() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3); 
-       m_aspect_ratio = GF_ASPECT_RATIO_4_3;
-}
-
-void CMainFrame::OnAr169() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9);        
-       m_aspect_ratio = GF_ASPECT_RATIO_16_9;
-}
-
-void CMainFrame::OnUpdateAr169(CCmdUI* pCmdUI) 
-{
-       pCmdUI->SetCheck(m_aspect_ratio == GF_ASPECT_RATIO_16_9);
-}
-
-void CMainFrame::OnUpdateAr43(CCmdUI* pCmdUI) 
-{
-       pCmdUI->SetCheck(m_aspect_ratio == GF_ASPECT_RATIO_4_3);
-}
-
-void CMainFrame::OnUpdateArFill(CCmdUI* pCmdUI) 
-{
-       pCmdUI->SetCheck(m_aspect_ratio == GF_ASPECT_RATIO_FILL_SCREEN);
-}
-
-void CMainFrame::OnUpdateArKeep(CCmdUI* pCmdUI) 
-{
-       pCmdUI->SetCheck(m_aspect_ratio == GF_ASPECT_RATIO_KEEP);
-}
-
-void CMainFrame::OnUpdateNavigate(CCmdUI* pCmdUI)
-{
-       BOOL enable;
-       Osmo4 *app = GetApp();
-       pCmdUI->Enable(FALSE);
-       if (!app->m_isopen) return;
-       
-       u32 type = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION_TYPE);
-       enable = type ? TRUE : FALSE;
-
-       if (pCmdUI->m_nID==ID_NAV_RESET) {
-               pCmdUI->Enable(TRUE);
-               return;
-       }
-
-       u32 mode = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION);
-       /*common 2D/3D modes*/
-       if (pCmdUI->m_nID==ID_NAVIGATE_NONE) { pCmdUI->Enable(enable); pCmdUI->SetCheck(mode ? 0 : 1); }
-       else if (pCmdUI->m_nID==ID_NAVIGATE_EXAM) { pCmdUI->Enable(enable); pCmdUI->SetCheck((mode==GF_NAVIGATE_EXAMINE) ? 1 : 0); }
-       else if (pCmdUI->m_nID==ID_NAVIGATE_SLIDE) { pCmdUI->Enable(enable); pCmdUI->SetCheck((mode==GF_NAVIGATE_SLIDE) ? 1 : 0); }
-
-       if (type==GF_NAVIGATE_TYPE_2D) return;
-       pCmdUI->Enable(enable);         
-       if (pCmdUI->m_nID==ID_NAVIGATE_WALK) pCmdUI->SetCheck((mode==GF_NAVIGATE_WALK) ? 1 : 0);
-       else if (pCmdUI->m_nID==ID_NAVIGATE_FLY) pCmdUI->SetCheck((mode==GF_NAVIGATE_FLY) ? 1 : 0);
-       else if (pCmdUI->m_nID==ID_NAVIGATE_PAN) pCmdUI->SetCheck((mode==GF_NAVIGATE_PAN) ? 1 : 0);
-       else if (pCmdUI->m_nID==ID_NAVIGATE_VR) pCmdUI->SetCheck((mode==GF_NAVIGATE_VR) ? 1 : 0);
-       else if (pCmdUI->m_nID==ID_NAVIGATE_GAME) pCmdUI->SetCheck((mode==GF_NAVIGATE_GAME) ? 1 : 0);
-}
-
-
-void CMainFrame::SetNavigate(u32 mode)
-{
-       Osmo4 *app = GetApp();
-       gf_term_set_option(app->m_term, GF_OPT_NAVIGATION, mode);
-}
-void CMainFrame::OnNavigateNone() { SetNavigate(GF_NAVIGATE_NONE); }
-void CMainFrame::OnNavigateWalk() { SetNavigate(GF_NAVIGATE_WALK); }
-void CMainFrame::OnNavigateFly() { SetNavigate(GF_NAVIGATE_FLY); }
-void CMainFrame::OnNavigateExam() { SetNavigate(GF_NAVIGATE_EXAMINE); }
-void CMainFrame::OnNavigateSlide() { SetNavigate(GF_NAVIGATE_SLIDE); }
-void CMainFrame::OnNavigatePan() { SetNavigate(GF_NAVIGATE_PAN); }
-void CMainFrame::OnNavigateOrbit() { SetNavigate(GF_NAVIGATE_ORBIT); }
-void CMainFrame::OnNavigateVR() { SetNavigate(GF_NAVIGATE_VR); }
-void CMainFrame::OnNavigateGame() { SetNavigate(GF_NAVIGATE_GAME); }
-
-void CMainFrame::OnNavigateReset()
-{
-       Osmo4 *app = GetApp();
-       gf_term_set_option(app->m_term, GF_OPT_NAVIGATION_TYPE, 0);
-}
-
-
-LONG CMainFrame::OnNavigate(WPARAM /*wParam*/, LPARAM /*lParam*/)
-{
-       Osmo4 *gpac = GetApp();
-
-       /*this is a migrate instruction, just disconnect the player*/
-       if (gpac->m_navigate_url.IsEmpty() ) {
-               gf_term_disconnect(gpac->m_term);
-               return 0;
-       }
-
-       if (gf_term_is_supported_url(gpac->m_term, gpac->m_navigate_url, 1, gpac->m_NoMimeFetch)) {
-               char *str = gf_url_concatenate(m_pPlayList->GetURL(), gpac->m_navigate_url);
-               if (str) {
-                       m_pPlayList->Truncate();
-                       m_pPlayList->QueueURL(str);
-                       gf_free(str);
-                       m_pPlayList->RefreshList();
-                       m_pPlayList->PlayNext();
-                       return 0;
-               }
-       }
-       
-       if (m_bFullScreen) {
-               SetFullscreen();
-               m_bRestoreFS = 1;
-       }
-
-       console_message = gpac->m_navigate_url;
-       console_err = GF_OK;
-       PostMessage(WM_CONSOLEMSG);
-       ShellExecute(NULL, "open", (LPCSTR) gpac->m_navigate_url, NULL, NULL, SW_SHOWNORMAL);
-
-       return 0;
-}
-
-void CMainFrame::OnFileProp() 
-{
-       if (!m_pProps) {
-               m_pProps = new CFileProps(this);
-               m_pProps->Create(this);
-       }
-       m_pProps->ShowWindow(SW_SHOW);
-}
-
-void CMainFrame::OnUpdateFileProp(CCmdUI* pCmdUI) 
-{
-       pCmdUI->Enable(GetApp()->m_isopen);     
-}
-
-void CMainFrame::OnConfigure() 
-{
-       if (!m_pOpt) {
-               m_pOpt = new COptions(this);
-               m_pOpt->Create(this);
-       }
-       m_pOpt->ShowWindow(SW_SHOW);
-}
-
-void CMainFrame::OnShortcuts() 
-{
-       MessageBox(
-               "Open File: Ctrl + O\n"
-               "Open URL: Ctrl + U\n"
-               "Reload File: Ctrl + R\n"
-               "Pause/Resume File: Ctrl + P\n"
-               "Step by Step: Ctrl + S\n"
-               "Seek +5%: Alt + left arrow\n"
-               "Seek -5%: Alt + right arrow\n"
-               "Seek +1min: Alt + up arrow\n"
-               "Seek -1min: Alt + down arrow\n"
-               "Fullscreen On/Off: Alt+Return or Escape\n"
-               "\n"
-               "Show Properties: Ctrl + I\n"
-               "Show Playlist: Ctrl + V\n"
-               "Next Playlist Item: Ctrl + right arrow\n"
-               "Previous Playlist Item: Ctrl + left arrow\n"
-               "\n"
-               "Aspect Ratio Normal: Ctrl + 1\n"
-               "Aspect Ratio Fill: Ctrl + 2\n"
-               "Aspect Ratio 4/3: Ctrl + 3\n"
-               "Aspect Ratio 16/9: Ctrl + 4\n"
-               
-               
-               , "Shortcuts Available on Osmo4", MB_OK);
-}
-
-void CMainFrame::OnNavInfo() 
-{
-       MessageBox(
-               "* Walk & Fly modes:\n"
-               "\tH move: H pan - V move: Z-translate - V move+CTRL or Wheel: V pan - Right Click (Walk only): Jump\n"
-               "\tleft/right: H pan - left/right+CTRL: H translate - up/down: Z-translate - up/down+CTRL: V pan\n"
-               "* Pan mode:\n"
-               "\tH move: H pan - V move: V pan - V move+CTRL or Wheel: Z-translate\n"
-               "\tleft/right: H pan - left/right+CTRL: H translate - up/down: V pan - up/down+CTRL: Z-translate\n"
-               "* Slide mode:\n"
-               "\tH move: H translate - V move: V translate - V move+CTRL or Wheel: Z-translate\n"
-               "\tleft/right: H translate - left/right+CTRL: H pan - up/down: V translate - up/down+CTRL: Z-translate\n"
-               "* Examine & Orbit mode:\n"
-               "\tH move: Y-Axis rotate - H move+CTRL: Z-Axis rotate - V move: X-Axis rotate - V move+CTRL or Wheel: Z-translate\n"
-               "\tleft/right: Y-Axis rotate - left/right+CTRL: H translate - up/down: X-Axis rotate - up/down+CTRL: Y-translate\n"
-               "* VR mode:\n"
-               "\tH move: H pan - V move: V pan - V move+CTRL or Wheel: Camera Zoom\n"
-               "\tleft/right: H pan - up/down: V pan - up/down+CTRL: Camera Zoom\n"
-               "* Game mode (press END to escape):\n"
-               "\tH move: H pan - V move: V pan\n"
-               "\tleft/right: H translate - up/down: Z-translate\n"
-               "\n"
-               "* All 3D modes: CTRL+PGUP/PGDOWN will zoom in/out camera (field of view) \n"
-
-               "\n"
-               "*Slide Mode in 2D:\n"
-               "\tH move: H translate - V move: V translate - V move+CTRL: zoom\n"
-               "\tleft/right: H translate - up/down: V translate - up/down+CTRL: zoom\n"
-               "*Examine Mode in 2D (3D renderer only):\n"
-               "\tH move: Y-Axis rotate - V move: X-Axis rotate\n"
-               "\tleft/right: Y-Axis rotate - up/down: X-Axis rotate\n"
-
-               "\n"
-               "HOME: reset navigation to last viewpoint (2D or 3D navigation)\n"
-               "SHIFT key in all modes: fast movement\n"
-
-               , "3D navigation keys (\'H\'orizontal and \'V\'ertical) used in GPAC", MB_OK);
-}
-
-
-
-void CMainFrame::BuildViewList()
-{
-       Osmo4 *app = GetApp();
-       if (!app->m_isopen) return;
-
-       /*THIS IS HARCODED FROM THE MENU LAYOUT */
-       CMenu *pMenu = GetMenu()->GetSubMenu(1)->GetSubMenu(0);
-       while (pMenu->GetMenuItemCount()) pMenu->DeleteMenu(0, MF_BYPOSITION);
-
-       s32 id = ID_VP_0;
-       nb_viewpoints = 0;
-       while (1) {
-               const char *szName = NULL;
-               Bool bound;
-               GF_Err e = gf_term_get_viewpoint(app->m_term, nb_viewpoints+1, &szName, &bound);
-               if (e) break;
-               if (szName) {
-                       pMenu->AppendMenu(MF_ENABLED, id+nb_viewpoints, szName);
-               } else {
-                       char szLabel[1024];
-                       sprintf(szLabel, "Viewpoint #%d", nb_viewpoints+1);
-                       pMenu->AppendMenu(MF_ENABLED, id+nb_viewpoints, szLabel);
-               }
-               nb_viewpoints++;
-               if (nb_viewpoints==ID_VP_19-ID_VP_0) break;
-       }
-}
-
-
-void CMainFrame::BuildStreamList(Bool reset_only)
-{
-       u32 nb_subs;
-       CMenu *pSelect;
-       Osmo4 *app = GetApp();
-
-       pSelect = GetMenu()->GetSubMenu(2)->GetSubMenu(0);
-       /*THIS IS HARCODED FROM THE MENU LAYOUT */
-       CMenu *pMenu = pSelect->GetSubMenu(0);
-       while (pMenu->GetMenuItemCount()) pMenu->DeleteMenu(0, MF_BYPOSITION);
-       pMenu = pSelect->GetSubMenu(1);
-       while (pMenu->GetMenuItemCount()) pMenu->DeleteMenu(0, MF_BYPOSITION);
-       pMenu = pSelect->GetSubMenu(2);
-       while (pMenu->GetMenuItemCount()) pMenu->DeleteMenu(0, MF_BYPOSITION);
-
-       if (reset_only) {
-               m_bFirstStreamQuery = 1;
-               return;
-       }
-       if (!app->m_isopen || !gf_term_get_option(app->m_term, GF_OPT_CAN_SELECT_STREAMS)) return;
-
-       GF_ObjectManager *root_od = gf_term_get_root_object(app->m_term);
-       if (!root_od) return;
-       u32 count = gf_term_get_object_count(app->m_term, root_od);
-       nb_subs = 0;
-
-       for (u32 i=0; i<count; i++) {
-               char szLabel[1024];
-               GF_MediaInfo info;
-               GF_ObjectManager *odm = gf_term_get_object(app->m_term, root_od, i);
-               if (!odm) return;
-
-               if (gf_term_get_object_info(app->m_term, odm, &info) != GF_OK) break;
-               if (info.owns_service) {
-                       char *szName = (char *)strrchr(info.service_url, '\\');
-                       if (!szName) szName = (char *)strrchr(info.service_url, '/');
-                       if (!szName) szName = (char *) info.service_url;
-                       else szName += 1;
-                       strcpy(szLabel, szName);
-                       szName = strrchr(szLabel, '.');
-                       if (szName) szName[0] = 0;
-               }
-
-               switch (info.od_type) {
-               case GF_STREAM_AUDIO:
-                       pMenu = pSelect->GetSubMenu(0);
-                       if (!info.owns_service) {
-                               if (info.lang) {
-                                       sprintf(szLabel, "Language %s (ID %d)", gf_4cc_to_str(info.lang), info.od->objectDescriptorID);
-                               } else {
-                                       sprintf(szLabel, "ID %d", info.od->objectDescriptorID);
-                               }
-                       }
-                       pMenu->AppendMenu(MF_ENABLED, ID_SELOBJ_0 + i, szLabel);
-                       break;
-               case GF_STREAM_VISUAL:
-                       pMenu = pSelect->GetSubMenu(1);
-                       if (!info.owns_service) sprintf(szLabel, "ID %d", info.od->objectDescriptorID);
-                       pMenu->AppendMenu(MF_ENABLED, ID_SELOBJ_0 + i, szLabel);
-                       break;
-               case GF_STREAM_TEXT:
-                       nb_subs ++;
-                       pMenu = pSelect->GetSubMenu(2);
-                       if (!info.owns_service) {
-                               if (info.lang) {
-                                       sprintf(szLabel, "Language %s (ID %d)", gf_4cc_to_str(info.lang), info.od->objectDescriptorID);
-                               } else {
-                                       sprintf(szLabel, "ID %d", info.od->objectDescriptorID);
-                               }
-                       }
-                       pMenu->AppendMenu(MF_ENABLED, ID_SELOBJ_0 + i, szLabel);
-                       break;
-               }
-       }
-       if (m_bFirstStreamQuery) {
-               m_bFirstStreamQuery = 0;
-               if (!nb_subs && app->m_LookForSubtitles) LookForSubtitles();
-       }
-
-}
-
-BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
-{
-       int ID = LOWORD(wParam);
-       Osmo4 *app = GetApp();
-
-       if ( (ID>=ID_VP_0) && (ID<=ID_VP_0+nb_viewpoints)) {
-               ID -= ID_VP_0;
-               gf_term_set_viewpoint(app->m_term, ID+1, NULL);
-               return TRUE;
-       }
-       if ( (ID>=ID_NAV_PREV_0) && (ID<=ID_NAV_PREV_9)) {
-               ID -= ID_NAV_PREV_0;
-               s32 prev = m_pPlayList->m_cur_entry - ID;
-               if (prev>=0) {
-                       m_pPlayList->m_cur_entry = prev;
-                       m_pPlayList->PlayPrev();
-               }
-               return TRUE;
-       }
-       if ( (ID>=ID_NAV_NEXT_0) && (ID<=ID_NAV_NEXT_9)) {
-               ID -= ID_NAV_NEXT_0;
-               u32 next = m_pPlayList->m_cur_entry + ID;
-               if (next < gf_list_count(m_pPlayList->m_entries) ) {
-                       m_pPlayList->m_cur_entry = next;
-                       m_pPlayList->PlayNext();
-               }
-               return TRUE;
-       }
-       if ( (ID>=ID_SELOBJ_0) && (ID<=ID_SELOBJ_29)) {
-               ID -= ID_SELOBJ_0;
-               GF_ObjectManager *root_od = gf_term_get_root_object(app->m_term);
-               if (!root_od) return TRUE;
-               GF_ObjectManager *odm = gf_term_get_object(app->m_term, root_od, ID);
-               gf_term_select_object(app->m_term, odm);
-               return TRUE;
-       }
-       if ( (ID>=ID_SETCHAP_FIRST) && (ID<=ID_SETCHAP_LAST)) {
-               ID -= ID_SETCHAP_FIRST;
-               gf_term_play_from_time(app->m_term, (u32) (1000*m_chapters_start[ID]), 0);
-               return TRUE;
-       }
-       return CFrameWnd::OnCommand(wParam, lParam);
-}
-
-void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT ID, BOOL bSys)
-{
-       Osmo4 *app = GetApp();
-       /*viewport list*/
-       if (pPopupMenu->GetMenuItemID(0)==ID_VP_0) {
-               for (int i=0; i<nb_viewpoints; i++) {
-                       const char *szName;
-                       Bool bound;
-                       GF_Err e = gf_term_get_viewpoint(app->m_term, i+1, &szName, &bound);
-                       pPopupMenu->EnableMenuItem(i, MF_BYPOSITION);
-                       if (bound) pPopupMenu->CheckMenuItem(i, MF_BYPOSITION | MF_CHECKED);
-               }
-               return;
-       }
-       /*navigation*/
-       if ((pPopupMenu->GetMenuItemID(0)==ID_NAV_PREV_0) || (pPopupMenu->GetMenuItemID(0)==ID_NAV_NEXT_0)) {
-               int count = pPopupMenu->GetMenuItemCount();
-               for (int i=0; i<count; i++) {
-                       pPopupMenu->EnableMenuItem(i, MF_BYPOSITION);           
-               }
-               return;
-       }
-       /*stream selection*/
-       if (pPopupMenu->m_hMenu == GetMenu()->GetSubMenu(2)->m_hMenu) {
-               if (!app->m_isopen || !gf_term_get_option(app->m_term, GF_OPT_CAN_SELECT_STREAMS)) {
-                       pPopupMenu->EnableMenuItem(0, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
-               } else {
-                       pPopupMenu->EnableMenuItem(0, MF_BYPOSITION | MF_ENABLED);
-               }
-       }
-       if ((pPopupMenu->GetMenuItemID(0)>=ID_SELOBJ_0) && (pPopupMenu->GetMenuItemID(0)<=ID_SELOBJ_29)) {
-               GF_ObjectManager *root_od = gf_term_get_root_object(app->m_term);
-               if (!root_od) return;
-
-               int count = pPopupMenu->GetMenuItemCount();
-               for (int i=0; i<count; i++) {
-                       u32 id = pPopupMenu->GetMenuItemID(i) - ID_SELOBJ_0;
-                       GF_ObjectManager *odm = gf_term_get_object(app->m_term, root_od, id);
-                       if (!odm) {
-                               pPopupMenu->EnableMenuItem(i, MF_DISABLED | MF_BYPOSITION);
-                       } else {
-                               GF_MediaInfo info;
-
-                               gf_term_get_object_info(app->m_term, odm, &info);
-                               pPopupMenu->EnableMenuItem(i, MF_BYPOSITION);
-                               pPopupMenu->CheckMenuItem(i, MF_BYPOSITION | (info.status ? MF_CHECKED : MF_UNCHECKED) );
-                       }
-               }
-               return;
-       }
-       /*chapters*/
-       if (pPopupMenu->m_hMenu == GetMenu()->GetSubMenu(2)->m_hMenu) {
-               if (!app->m_isopen || !m_num_chapters) {
-                       pPopupMenu->EnableMenuItem(1, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
-               } else {
-                       pPopupMenu->EnableMenuItem(1, MF_BYPOSITION | MF_ENABLED);
-               }
-       }
-       if ((pPopupMenu->GetMenuItemID(0)>=ID_SETCHAP_FIRST) && (pPopupMenu->GetMenuItemID(0)<=ID_SETCHAP_LAST)) {
-               Double now = gf_term_get_time_in_ms(app->m_term);
-               now /= 1000;
-
-               int count = pPopupMenu->GetMenuItemCount();
-               for (int i=0; i<count; i++) {
-                       u32 id = pPopupMenu->GetMenuItemID(i) - ID_SETCHAP_FIRST;
-                       pPopupMenu->EnableMenuItem(i, MF_BYPOSITION);
-
-                       Bool is_current = 0;
-                       if (m_chapters_start[id]<=now) {
-                               if (id+1<m_num_chapters) {
-                                       if (m_chapters_start[id+1]>now) is_current = 1;
-                               } else {
-                                       is_current = 1;
-                               }
-                       }
-                       pPopupMenu->CheckMenuItem(i, MF_BYPOSITION | (is_current ? MF_CHECKED : MF_UNCHECKED));
-               }
-               return;
-       }
-       /*default*/
-       CFrameWnd::OnInitMenuPopup(pPopupMenu, ID, bSys);
-}
-
-void CMainFrame::OnCollideDisp() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_COLLISION, GF_COLLISION_DISPLACEMENT);
-}
-
-void CMainFrame::OnUpdateCollideDisp(CCmdUI* pCmdUI) 
-{
-       Osmo4 *gpac = GetApp(); 
-       pCmdUI->Enable(gpac->m_isopen); 
-       pCmdUI->SetCheck( (gf_term_get_option(gpac->m_term, GF_OPT_COLLISION) == GF_COLLISION_DISPLACEMENT) ? 1 : 0);
-}
-
-void CMainFrame::OnCollideNone() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_COLLISION, GF_COLLISION_NONE);
-}
-
-void CMainFrame::OnUpdateCollideNone(CCmdUI* pCmdUI) 
-{
-       Osmo4 *gpac = GetApp(); 
-       pCmdUI->Enable(gpac->m_isopen); 
-       pCmdUI->SetCheck( (gf_term_get_option(gpac->m_term, GF_OPT_COLLISION) == GF_COLLISION_NONE) ? 1 : 0);
-}
-
-void CMainFrame::OnCollideReg() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_COLLISION, GF_COLLISION_NORMAL);
-}
-
-void CMainFrame::OnUpdateCollideReg(CCmdUI* pCmdUI) 
-{
-       Osmo4 *gpac = GetApp(); 
-       pCmdUI->Enable(gpac->m_isopen); 
-       pCmdUI->SetCheck( (gf_term_get_option(gpac->m_term, GF_OPT_COLLISION) == GF_COLLISION_NORMAL) ? 1 : 0);
-}
-
-void CMainFrame::OnHeadlight() 
-{
-       Osmo4 *app = GetApp();
-       Bool val = !gf_term_get_option(app->m_term, GF_OPT_HEADLIGHT);
-       gf_term_set_option(app->m_term, GF_OPT_HEADLIGHT, val);
-}
-
-void CMainFrame::OnUpdateHeadlight(CCmdUI* pCmdUI) 
-{
-       Osmo4 *app = GetApp();
-       pCmdUI->Enable(FALSE);
-       if (!app->m_isopen) return;
-       u32 type = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION_TYPE);
-       if (type!=GF_NAVIGATE_TYPE_3D) return;
-
-       pCmdUI->Enable(TRUE);
-       pCmdUI->SetCheck(gf_term_get_option(app->m_term, GF_OPT_HEADLIGHT) ? 1 : 0);
-}
-
-void CMainFrame::OnGravity() 
-{
-       Osmo4 *app = GetApp();
-       Bool val = gf_term_get_option(app->m_term, GF_OPT_GRAVITY) ? 0 : 1;
-       gf_term_set_option(app->m_term, GF_OPT_GRAVITY, val);
-}
-
-void CMainFrame::OnUpdateGravity(CCmdUI* pCmdUI) 
-{
-       Osmo4 *app = GetApp();
-       pCmdUI->Enable(FALSE);
-       if (!app->m_isopen) return;
-       u32 type = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION_TYPE);
-       if (type!=GF_NAVIGATE_TYPE_3D) return;
-       type = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION);
-       if (type != GF_NAVIGATE_WALK) return;
-       pCmdUI->Enable(TRUE);
-       pCmdUI->SetCheck(gf_term_get_option(app->m_term, GF_OPT_GRAVITY) ? 1 : 0);
-}
-
-
-BOOL CMainFrame::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) 
-{
-
-       if (((LPNMHDR)lParam)->code == TBN_DROPDOWN) {
-               RECT rc;
-               s32 i, count, start;
-               POINT pt;
-               CMenu *pPopup = new CMenu();
-               pPopup->CreatePopupMenu();
-
-               m_wndToolBar.GetWindowRect(&rc);
-               pt.y = rc.bottom;
-               pt.x = rc.left;
-               m_wndToolBar.GetToolBarCtrl().GetItemRect(0, &rc);
-               pt.x += (rc.right - rc.left);
-               m_wndToolBar.GetToolBarCtrl().GetItemRect(1, &rc);
-               pt.x += (rc.right - rc.left);
-
-               count = gf_list_count(m_pPlayList->m_entries);
-               if ( ((LPNMTOOLBAR)lParam)->iItem == ID_NAV_PREV) {
-                       start = m_pPlayList->m_cur_entry - 1;
-                       for (i=0; i<10; i++) {
-                               if (start - i < 0) break;
-                               if (start - i >= count) break;
-                               PLEntry *ple = (PLEntry *) gf_list_get(m_pPlayList->m_entries, start - i);
-                               pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_NAV_PREV_0 + i, ple->m_disp_name);
-                       }
-               } else {
-                       start = m_pPlayList->m_cur_entry + 1;
-                       for (i=0; i<10; i++) {
-                               if (start + i >= count) break;
-                               PLEntry *ple = (PLEntry *) gf_list_get(m_pPlayList->m_entries, start + i);
-                               pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_NAV_NEXT_0 + i, ple->m_disp_name);
-                       }
-                       m_wndToolBar.GetToolBarCtrl().GetItemRect(2, &rc);
-                       pt.x += (rc.right - rc.left);
-               }
-               pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, this);
-               delete pPopup;
-
-               return FALSE;
-       }
-       return CFrameWnd::OnNotify(wParam, lParam, pResult);
-}
-
-void CMainFrame::OnNavNext() 
-{
-       Osmo4 *app = GetApp();
-       /*don't play if last could trigger playlist loop*/
-       if ((m_pPlayList->m_cur_entry<0) || (gf_list_count(m_pPlayList->m_entries) == 1 + (u32) m_pPlayList->m_cur_entry)) return;
-       m_pPlayList->PlayNext();
-}
-
-void CMainFrame::OnUpdateNavNext(CCmdUI* pCmdUI) 
-{
-       if (m_pPlayList->m_cur_entry<0) pCmdUI->Enable(FALSE);
-       else if ((u32) m_pPlayList->m_cur_entry + 1 == gf_list_count(m_pPlayList->m_entries) ) pCmdUI->Enable(FALSE);
-       else pCmdUI->Enable(TRUE);
-}
-
-void CMainFrame::OnNavPrev() 
-{
-       Osmo4 *app = GetApp();
-       if (m_pPlayList->m_cur_entry<=0) return;
-       m_pPlayList->PlayPrev();
-}
-
-void CMainFrame::OnUpdateNavPrev(CCmdUI* pCmdUI) 
-{
-       if (m_pPlayList->m_cur_entry<=0) pCmdUI->Enable(FALSE);
-       else pCmdUI->Enable(TRUE);
-}
-
-
-void CMainFrame::OnClearNav() 
-{
-       m_pPlayList->ClearButPlaying();
-}
-
-void CMainFrame::OnViewPlaylist() 
-{
-       m_pPlayList->ShowWindow(m_pPlayList->IsWindowVisible() ? SW_HIDE : SW_SHOW);
-}
-
-void CMainFrame::OnUpdateViewPlaylist(CCmdUI* pCmdUI) 
-{
-       pCmdUI->SetCheck(m_pPlayList->IsWindowVisible() ? 1 : 0);
-}
-void CMainFrame::OnPlaylistLoop() 
-{
-       GetApp()->m_Loop = !GetApp()->m_Loop;
-}
-
-void CMainFrame::OnUpdatePlaylistLoop(CCmdUI* pCmdUI) 
-{
-       pCmdUI->SetCheck(GetApp()->m_Loop ? 1 : 0);
-}
-
-void CMainFrame::OnAddSubtitle() 
-{
-       CFileDialog fd(TRUE,NULL,NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, "All Subtitles|*.srt;*.sub;*.ttxt;*.xml|SRT Subtitles|*.srt|SUB Subtitles|*.sub|3GPP TimedText|*.ttxt|QuckTime TeXML|*.xml|");
-       if (fd.DoModal() != IDOK) return;
-
-       AddSubtitle(fd.GetPathName(), 1);
-}
-
-void CMainFrame::AddSubtitle(const char *fileName, Bool auto_play)
-{
-       gf_term_add_object(GetApp()->m_term, fileName, auto_play);
-}
-
-static Bool subs_enum_dir_item(void *cbck, char *item_name, char *item_path)
-{
-       CMainFrame *_this = (CMainFrame *)cbck;
-       _this->AddSubtitle(item_path, 0);
-       return 0;
-}
-
-void CMainFrame::LookForSubtitles()
-{
-       char dir[GF_MAX_PATH];
-       CString url = m_pPlayList->GetURL();
-       strcpy(dir, url);
-       char *sep = strrchr(dir, '\\');
-       if (!sep) ::GetCurrentDirectory(GF_MAX_PATH, dir);
-       else sep[0] = 0;
-
-       gf_enum_directory(dir, 0, subs_enum_dir_item, this, "ttxt;srt");
-}
-
-void CMainFrame::OnCacheEnable()
-{
-       Osmo4 *app = GetApp();
-       u32 state = gf_term_get_option(app->m_term, GF_OPT_MEDIA_CACHE);
-       if (state==GF_MEDIA_CACHE_DISABLED) {
-               gf_term_set_option(app->m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_ENABLED);
-       } else if (state==GF_MEDIA_CACHE_DISABLED) {
-               gf_term_set_option(app->m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISABLED);
-       }
-}
-
-void CMainFrame::OnUpdateCacheEnable(CCmdUI* pCmdUI) 
-{
-       Osmo4 *app = GetApp();
-       u32 state = gf_term_get_option(app->m_term, GF_OPT_MEDIA_CACHE);
-       switch (state) {
-       case GF_MEDIA_CACHE_ENABLED:
-               pCmdUI->SetText("Enabled"); 
-               pCmdUI->Enable(TRUE); 
-               break;
-       case GF_MEDIA_CACHE_RUNNING: 
-               pCmdUI->SetText("Running");
-               pCmdUI->Enable(FALSE); 
-               break;
-       case GF_MEDIA_CACHE_DISABLED: 
-               pCmdUI->SetText("Disabled");
-               break;
-       }
-}
-
-void CMainFrame::OnUpdateCacheStop(CCmdUI* pCmdUI) 
-{
-       Osmo4 *app = GetApp();
-       u32 state = gf_term_get_option(app->m_term, GF_OPT_MEDIA_CACHE);
-       pCmdUI->Enable( (state==GF_MEDIA_CACHE_RUNNING) ? TRUE : FALSE);
-}
-
-void CMainFrame::OnCacheStop()
-{
-       Osmo4 *app = GetApp();
-       gf_term_set_option(app->m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISABLED);
-}
-void CMainFrame::OnCacheAbort()
-{
-       Osmo4 *app = GetApp();
-       gf_term_set_option(app->m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISCARD);
-}
-
-void CMainFrame::OnFileExit() 
-{
-       DestroyWindow();
-}
-
-
-void CMainFrame::BuildChapterList(Bool reset_only)
-{
-       CMenu *pChaps;
-       GF_MediaInfo odi;
-       NetInfoCommand com;
-       Osmo4 *app = GetApp();
-
-       /*THIS IS HARCODED FROM THE MENU LAYOUT */
-       pChaps = GetMenu()->GetSubMenu(2)->GetSubMenu(1);
-       while (pChaps->GetMenuItemCount()) pChaps->DeleteMenu(0, MF_BYPOSITION);
-
-       if (m_chapters_start) gf_free(m_chapters_start);
-       m_chapters_start = NULL;
-       m_num_chapters = 0;
-       if (reset_only) return;
-
-       GF_ObjectManager *root_od = gf_term_get_root_object(app->m_term);
-       if (!root_od) return;
-       if (gf_term_get_object_info(app->m_term, root_od, &odi) != GF_OK) return;
-
-       u32 count = gf_list_count(odi.od->OCIDescriptors);
-       m_num_chapters = 0;
-       for (u32 i=0; i<count; i++) {
-               char szLabel[1024];
-               GF_Segment *seg = (GF_Segment *) gf_list_get(odi.od->OCIDescriptors, i);
-               if (seg->tag != GF_ODF_SEGMENT_TAG) continue;
-
-               if (seg->SegmentName && strlen((const char *)seg->SegmentName)) {
-                       strcpy(szLabel, (const char *) seg->SegmentName);
-               } else {
-                       sprintf(szLabel, "Chapter #%02d", m_num_chapters+1);
-               }
-               pChaps->AppendMenu(MF_ENABLED, ID_SETCHAP_FIRST + m_num_chapters, szLabel);
-
-               m_chapters_start = (Double *) gf_realloc(m_chapters_start, sizeof(Double)*(m_num_chapters+1));
-               m_chapters_start[m_num_chapters] = seg->startTime;
-               m_num_chapters++;
-       }
-
-       /*get any service info*/
-       if (!m_bStartupFile && gf_term_get_service_info(app->m_term, root_od, &com) == GF_OK) {
-               CString title("");
-               if (com.track_info) { title.Format("%02d ", (u32) (com.track_info>>16) ); }
-               if (com.artist) { title += com.artist; title += " "; }
-               if (com.name) { title += com.name; title += " "; }
-               if (com.album) { title += "("; title += com.album; title += ")"; }
-               
-               if (title.GetLength()) SetWindowText(title);
-       }
-}
-
-void CMainFrame::OnViewCPU()
-{
-       m_show_rti = !m_show_rti;
-}
-
-void CMainFrame::OnUpdateViewCPU(CCmdUI* pCmdUI) 
-{
-       pCmdUI->Enable(TRUE);
-       pCmdUI->SetCheck(m_show_rti);
-}
-
-
-void CMainFrame::OnFileCopy()
-{
-       u32 len;
-       const char *text = gf_term_get_text_selection(GetApp()->m_term, 0);
-       if (!text) return;
-
-       if (!IsClipboardFormatAvailable(CF_TEXT)) return;
-       if (!OpenClipboard()) return;
-       EmptyClipboard();
-       
-       len = strlen(text);
-       if (!len) return;
-
-       HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(char)); 
-       LPTSTR lptstrCopy = (char *) GlobalLock(hglbCopy);
-       memcpy(lptstrCopy, text, len * sizeof(char)); 
-       lptstrCopy[len] = 0;
-       GlobalUnlock(hglbCopy); 
-       SetClipboardData(CF_TEXT, hglbCopy);
-       CloseClipboard(); 
-}
-
-void CMainFrame::OnUpdateFileCopy(CCmdUI* pCmdUI)
-{
-       Osmo4 *app = GetApp();
-       if (IsClipboardFormatAvailable(CF_TEXT)
-               && app->m_term 
-               && (gf_term_get_text_selection(app->m_term, 1)!=NULL)
-       ) {
-               pCmdUI->Enable(TRUE);
-       } else {
-               pCmdUI->Enable(FALSE);
-       }
-}
-
-
-void CMainFrame::OnFilePaste()
-{
-       if (!IsClipboardFormatAvailable(CF_TEXT)) return;
-       if (!OpenClipboard()) return;
-
-       HGLOBAL hglbCopy = GetClipboardData(CF_TEXT);
-       if (hglbCopy) {
-               LPTSTR lptstrCopy = (char *) GlobalLock(hglbCopy);
-               gf_term_paste_text(GetApp()->m_term, lptstrCopy, 0);
-               GlobalUnlock(hglbCopy); 
-       }
-       CloseClipboard(); 
-}
-
-void CMainFrame::OnUpdateFilePaste(CCmdUI* pCmdUI)
-{
-       Osmo4 *app = GetApp();
-       if (IsClipboardFormatAvailable(CF_TEXT)
-               && app->m_term 
-               && (gf_term_paste_text(app->m_term, NULL, 1)==GF_OK)
-       ) {
-               pCmdUI->Enable(TRUE);
-       } else {
-               pCmdUI->Enable(FALSE);
-       }
-}
-
-
diff --git a/applications/osmo4_w32/MainFrm.h b/applications/osmo4_w32/MainFrm.h
deleted file mode 100644 (file)
index 7eba87a..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-// MainFrm.h : interface of the CMainFrame class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_MAINFRM_H__3666B63B_D886_4F0B_9953_A2AF09E3C15A__INCLUDED_)
-#define AFX_MAINFRM_H__3666B63B_D886_4F0B_9953_A2AF09E3C15A__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include <gpac/tools.h>
-#include <gpac/constants.h>
-#include <gpac/modules/service.h>
-#include <gpac/options.h>
-
-#include "FileProps.h"
-#include "Options.h"
-#include "AddressBar.h"
-#include "Sliders.h"
-#include "Playlist.h"
-
-
-class CChildView : public CWnd
-{
-// Construction
-public:
-       CChildView();
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CChildView)
-       protected:
-       virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
-       //}}AFX_VIRTUAL
-
-// Implementation
-public:
-       virtual ~CChildView();
-
-       // Generated message map functions
-protected:
-       //{{AFX_MSG(CChildView)
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-
-class CMainFrame : public CFrameWnd
-{
-       
-public:
-       CMainFrame();
-protected: 
-       DECLARE_DYNAMIC(CMainFrame)
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CMainFrame)
-       public:
-       virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
-       virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
-       virtual BOOL DestroyWindow();
-       protected:
-       virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
-       //}}AFX_VIRTUAL
-
-// Implementation
-public:
-       virtual ~CMainFrame();
-#ifdef _DEBUG
-       virtual void AssertValid() const;
-       virtual void Dump(CDumpContext& dc) const;
-#endif
-
-public:  
-       CStatusBar  m_wndStatusBar;
-       CToolBar    m_wndToolBar;
-       Sliders m_Sliders;
-       AddressBar m_Address;
-       CFileProps *m_pProps;
-       COptions *m_pOpt;
-       Playlist *m_pPlayList;
-       CChildView *m_pWndView;
-       Bool m_bFullScreen, m_bRestoreFS;
-       u32 m_timer_on;
-       CString console_message;
-       CString console_service;
-       GF_Err console_err;
-       u32 m_aspect_ratio;
-       RECT backup_wnd_rc;
-       Bool m_bFirstStreamQuery;
-       /*filter progress events to avoid killing importers with status bar text display...*/
-       s32 m_last_prog;
-       Bool m_show_rti;
-       Bool m_bStartupFile;
-
-public:
-       void SetFullscreen();
-       void BuildViewList();
-       void BuildStreamList(Bool reset_ony);
-       void BuildChapterList(Bool reset_ony);
-       void SetProgTimer(Bool bOn);            
-       void AddSubtitle(const char *fileName, Bool auto_play);
-
-private:
-       void ForwardMessage();
-       HICON m_icoerror, m_icomessage;
-       s32 nb_viewpoints;
-       Bool m_bInitShow;
-
-       void SetNavigate(u32 mode);
-       void LookForSubtitles();
-
-       Double *m_chapters_start;
-       u32 m_num_chapters;
-
-
-// Generated message map functions
-protected:
-       //{{AFX_MSG(CMainFrame)
-       afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
-       afx_msg void OnSetFocus(CWnd *pOldWnd);
-       afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
-       afx_msg BOOL OnCommand(WPARAM wParam, LPARAM lParam);
-       afx_msg void OnSize(UINT nType, int cx, int cy);
-       afx_msg void OnMove(int x, int y);
-       afx_msg LONG OnSetSize(WPARAM wParam, LPARAM lParam);
-       afx_msg LONG OnNavigate(WPARAM wParam, LPARAM lParam);
-       afx_msg LONG Open(WPARAM wParam, LPARAM lParam);
-       afx_msg LONG NewInstanceOpened(WPARAM wParam, LPARAM lParam);
-
-       afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
-       afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
-       afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
-       afx_msg void OnChar( UINT nChar, UINT nRepCnt, UINT nFlags );
-       afx_msg void OnSysKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags );
-       afx_msg void OnSysKeyUp( UINT nChar, UINT nRepCnt, UINT nFlags );
-       afx_msg void OnKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags );
-       afx_msg void OnKeyUp( UINT nChar, UINT nRepCnt, UINT nFlags );
-       afx_msg void OnDropFiles(HDROP hDropInfo);
-       afx_msg LONG OnConsoleMessage(WPARAM wParam, LPARAM lParam);
-       afx_msg void OnViewOriginal();
-       afx_msg void OnViewFullscreen();
-       afx_msg void OnArKeep();
-       afx_msg void OnArFill();
-       afx_msg void OnAr43();
-       afx_msg void OnAr169();
-       afx_msg void OnUpdateAr169(CCmdUI* pCmdUI);
-       afx_msg void OnUpdateAr43(CCmdUI* pCmdUI);
-       afx_msg void OnUpdateArFill(CCmdUI* pCmdUI);
-       afx_msg void OnUpdateArKeep(CCmdUI* pCmdUI);
-       afx_msg void OnNavigateNone();
-       afx_msg void OnNavigateWalk();
-       afx_msg void OnNavigateFly();
-       afx_msg void OnNavigateExam();
-       afx_msg void OnNavigateSlide();
-       afx_msg void OnNavigatePan();
-       afx_msg void OnNavigateOrbit();
-       afx_msg void OnNavigateGame();
-       afx_msg void OnNavigateVR();
-       afx_msg void OnNavigateReset();
-       afx_msg void OnShortcuts();
-       afx_msg void OnConfigure();
-       afx_msg void OnFileProp();
-       afx_msg void OnViewPlaylist();
-       afx_msg void OnUpdateFileProp(CCmdUI* pCmdUI);
-       afx_msg void OnUpdateNavigate(CCmdUI* pCmdUI);
-       afx_msg void OnCacheEnable();
-       afx_msg void OnUpdateCacheEnable(CCmdUI* pCmdUI);
-       afx_msg void OnCacheStop();
-       afx_msg void OnCacheAbort();
-       afx_msg void OnUpdateCacheStop(CCmdUI* pCmdUI);
-       afx_msg void OnCollideDisp();
-       afx_msg void OnUpdateCollideDisp(CCmdUI* pCmdUI);
-       afx_msg void OnCollideNone();
-       afx_msg void OnUpdateCollideNone(CCmdUI* pCmdUI);
-       afx_msg void OnCollideReg();
-       afx_msg void OnUpdateCollideReg(CCmdUI* pCmdUI);
-       afx_msg void OnHeadlight();
-       afx_msg void OnUpdateHeadlight(CCmdUI* pCmdUI);
-       afx_msg void OnGravity();
-       afx_msg void OnUpdateGravity(CCmdUI* pCmdUI);
-       afx_msg void OnNavInfo();
-       afx_msg void OnNavNext();
-       afx_msg void OnNavPrev();
-       afx_msg void OnUpdateNavNext(CCmdUI* pCmdUI);
-       afx_msg void OnUpdateNavPrev(CCmdUI* pCmdUI);
-       afx_msg void OnClearNav();
-       afx_msg void OnUpdateViewPlaylist(CCmdUI* pCmdUI);
-       afx_msg void OnPlaylistLoop();
-       afx_msg void OnUpdatePlaylistLoop(CCmdUI* pCmdUI);
-       afx_msg void OnAddSubtitle();
-       afx_msg void OnFileExit();
-       afx_msg void OnViewCPU();
-       afx_msg void OnUpdateViewCPU(CCmdUI* pCmdUI);
-       afx_msg void OnFileCopy();
-       afx_msg void OnUpdateFileCopy(CCmdUI* pCmdUI);
-       afx_msg void OnFilePaste();
-       afx_msg void OnUpdateFilePaste(CCmdUI* pCmdUI);
-
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_MAINFRM_H__3666B63B_D886_4F0B_9953_A2AF09E3C15A__INCLUDED_)
diff --git a/applications/osmo4_w32/OpenUrl.cpp b/applications/osmo4_w32/OpenUrl.cpp
deleted file mode 100644 (file)
index 37f6279..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-// OpenUrl.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-#include "OpenUrl.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// COpenUrl dialog
-
-
-COpenUrl::COpenUrl(CWnd* pParent /*=NULL*/)
-       : CDialog(COpenUrl::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COpenUrl)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void COpenUrl::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COpenUrl)
-       DDX_Control(pDX, IDC_COMBOURL, m_URLs);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COpenUrl, CDialog)
-       //{{AFX_MSG_MAP(COpenUrl)
-       ON_BN_CLICKED(IDC_BUTGO, OnButgo)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-
-
-#define MAX_LAST_FILES         20
-void UpdateLastFiles(GF_Config *cfg, const char *URL)
-{
-       u32 nb_entries;
-       gf_cfg_set_key(cfg, "RecentFiles", URL, NULL);
-       gf_cfg_insert_key(cfg, "RecentFiles", URL, "", 0);
-       /*remove last entry if needed*/
-       nb_entries = gf_cfg_get_key_count(cfg, "RecentFiles");
-       if (nb_entries>MAX_LAST_FILES) {
-               gf_cfg_set_key(cfg, "RecentFiles", gf_cfg_get_key_name(cfg, "RecentFiles", nb_entries-1), NULL);
-       }
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// COpenUrl message handlers
-
-void COpenUrl::OnButgo() 
-{
-       CString URL;
-       int sel = m_URLs.GetCurSel();
-       if (sel == CB_ERR) {
-               m_URLs.GetWindowText(URL);
-       } else {
-               m_URLs.GetLBText(sel, URL);
-       }
-       if (!URL.GetLength()) {
-               EndDialog(IDCANCEL);
-               return;
-       }
-
-       Osmo4 *gpac = GetApp();
-
-       m_url = URL;
-       UpdateLastFiles(gpac->m_user.config, (const char *) URL);
-       EndDialog(IDOK);
-}
-
-BOOL COpenUrl::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-       Osmo4 *gpac = GetApp();
-       u32 i=0;
-
-       while (m_URLs.GetCount()) m_URLs.DeleteString(0);
-       while (1) {
-               const char *sOpt = gf_cfg_get_key_name(gpac->m_user.config, "RecentFiles", i);
-               if (!sOpt) break;
-               m_URLs.AddString(sOpt);
-               i++;
-       }
-       return TRUE;
-}
diff --git a/applications/osmo4_w32/OpenUrl.h b/applications/osmo4_w32/OpenUrl.h
deleted file mode 100644 (file)
index 4a4bd65..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#if !defined(AFX_OPENURL_H__ADB51A74_305E_4183_8D44_03EEB83D2BFA__INCLUDED_)
-#define AFX_OPENURL_H__ADB51A74_305E_4183_8D44_03EEB83D2BFA__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// OpenUrl.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// COpenUrl dialog
-
-class COpenUrl : public CDialog
-{
-// Construction
-public:
-       COpenUrl(CWnd* pParent = NULL);   // standard constructor
-       CString m_url;
-
-// Dialog Data
-       //{{AFX_DATA(COpenUrl)
-       enum { IDD = IDD_OPENFILE };
-       CComboBox       m_URLs;
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COpenUrl)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COpenUrl)
-       afx_msg void OnBrowse();
-       afx_msg void OnButgo();
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_OPENURL_H__ADB51A74_305E_4183_8D44_03EEB83D2BFA__INCLUDED_)
diff --git a/applications/osmo4_w32/Options.cpp b/applications/osmo4_w32/Options.cpp
deleted file mode 100644 (file)
index 974bc35..0000000
+++ /dev/null
@@ -1,1989 +0,0 @@
-// Options.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-#include "MainFrm.h"
-
-#include <gpac/modules/codec.h>
-#include <gpac/modules/raster2d.h>
-#include <gpac/modules/font.h>
-#include <gpac/modules/audio_out.h>
-#include <gpac/modules/video_out.h>
-
-#include <gpac/iso639.h>
-#include "Options.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions dialog
-
-
-COptions::COptions(CWnd* pParent /*=NULL*/)
-       : CDialog(COptions::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptions)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptions::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptions)
-       DDX_Control(pDX, IDC_SELECT, m_Selector);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptions, CDialog)
-       //{{AFX_MSG_MAP(COptions)
-       ON_BN_CLICKED(IDC_SAVEOPT, OnSaveopt)
-       ON_WM_CLOSE()
-       ON_WM_DESTROY()
-       ON_CBN_SELCHANGE(IDC_SELECT, OnSelchangeSelect)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-BOOL COptions::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-       m_general.Create(IDD_OPT_GEN, this);
-       m_systems.Create(IDD_OPT_SYSTEMS, this);
-       m_render.Create(IDD_OPT_RENDER, this);
-       m_render2d.Create(IDD_OPT_RENDER2D, this);
-       m_render3d.Create(IDD_OPT_RENDER3D, this);
-       m_decoder.Create(IDD_OPT_DECODER, this);
-       m_audio.Create(IDD_OPT_AUDIO, this);
-       m_video.Create(IDD_OPT_VIDEO, this);
-       m_http.Create(IDD_OPT_HTTP, this);
-       m_font.Create(IDD_OPT_FONT, this);
-       m_stream.Create(IDD_OPT_STREAM, this);
-       m_cache.Create(IDD_OPT_MCACHE, this);
-       m_files.Create(IDD_OPT_FILETYPES, this);
-       m_logs.Create(IDD_OPT_LOGS, this);
-
-       m_Selector.AddString("General");
-       m_Selector.AddString("MPEG-4 Systems");
-       m_Selector.AddString("Media Decoders");
-       m_Selector.AddString("Compositor");
-       m_Selector.AddString("2D Drawing");
-       m_Selector.AddString("3D Drawing");
-       m_Selector.AddString("Video Output");
-       m_Selector.AddString("Audio Output");
-       m_Selector.AddString("Text Engine");
-       m_Selector.AddString("File Download");
-       m_Selector.AddString("Real-Time Streaming");
-       m_Selector.AddString("Streaming Cache");
-       m_Selector.AddString("File Types");
-       m_Selector.AddString("Log System");
-
-       HideAll();
-
-       const char *sOpt = gf_cfg_get_key(GetApp()->m_user.config, "General", "ConfigPanel");
-       u32 sel = sOpt ? atoi(sOpt) : 0;
-       if (sel>13) sel=13;
-       m_Selector.SetCurSel(sel);
-       m_general.ShowWindow(SW_SHOW);
-       
-       OnSelchangeSelect();
-
-       return TRUE;  
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions message handlers
-
-void COptions::HideAll()
-{
-       m_general.ShowWindow(SW_HIDE);
-       m_systems.ShowWindow(SW_HIDE);
-       m_render.ShowWindow(SW_HIDE);
-       m_render2d.ShowWindow(SW_HIDE);
-       m_render3d.ShowWindow(SW_HIDE);
-       m_audio.ShowWindow(SW_HIDE);
-       m_video.ShowWindow(SW_HIDE);
-       m_http.ShowWindow(SW_HIDE);
-       m_font.ShowWindow(SW_HIDE);
-       m_stream.ShowWindow(SW_HIDE);
-       m_decoder.ShowWindow(SW_HIDE);
-       m_cache.ShowWindow(SW_HIDE);
-       m_files.ShowWindow(SW_HIDE);
-       m_files.ShowWindow(SW_HIDE);
-       m_logs.ShowWindow(SW_HIDE);
-}
-
-void COptions::OnSelchangeSelect() 
-{
-       HideAll();
-       switch (m_Selector.GetCurSel()) {
-       case 0: m_general.ShowWindow(SW_SHOW); break;
-       case 1: m_systems.ShowWindow(SW_SHOW); break;
-       case 2: m_decoder.ShowWindow(SW_SHOW); break;
-       case 3: m_render.ShowWindow(SW_SHOW); break;
-       case 4: m_render2d.ShowWindow(SW_SHOW); break;
-       case 5: m_render3d.ShowWindow(SW_SHOW); break;
-       case 6: m_video.ShowWindow(SW_SHOW); break;
-       case 7: m_audio.ShowWindow(SW_SHOW); break;
-       case 8: m_font.ShowWindow(SW_SHOW); break;
-       case 9: m_http.ShowWindow(SW_SHOW); break;
-       case 10: m_stream.ShowWindow(SW_SHOW); break;
-       case 11: m_cache.ShowWindow(SW_SHOW); break;
-       case 12: m_files.ShowWindow(SW_SHOW); break;
-       case 13: m_logs.ShowWindow(SW_SHOW); break;
-       }
-}
-
-void COptions::OnSaveopt() 
-{
-       m_general.SaveOptions();
-       m_systems.SaveOptions();
-       m_decoder.SaveOptions();
-       m_render.SaveOptions();
-       m_render2d.SaveOptions();
-       m_render3d.SaveOptions();
-       m_audio.SaveOptions();
-       m_video.SaveOptions();
-       m_http.SaveOptions();
-       m_font.SaveOptions();
-       m_stream.SaveOptions();
-       m_cache.SaveOptions();
-       m_logs.SaveOptions();
-
-       Osmo4 *gpac = GetApp();
-       gf_term_set_option(gpac->m_term, GF_OPT_RELOAD_CONFIG, 1);
-       m_render2d.SetYUV();
-}
-
-void COptions::OnClose() 
-{
-       char str[20];
-       sprintf(str, "%d", m_Selector.GetCurSel());
-       gf_cfg_set_key(GetApp()->m_user.config, "General", "ConfigPanel", str);
-
-       DestroyWindow();
-}
-
-void COptions::OnDestroy() 
-{
-       CDialog::OnDestroy();
-       delete this;
-       ((CMainFrame *)GetApp()->m_pMainWnd)->m_pOpt = NULL;
-}
-
-
-COptGen::COptGen(CWnd* pParent /*=NULL*/)
-       : CDialog(COptGen::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptGen)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptGen::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptGen)
-       DDX_Control(pDX, IDC_LOOKFORSUB, m_LookForSubs);
-       DDX_Control(pDX, IDC_DUMP_XMT, m_ViewXMT);
-       DDX_Control(pDX, IDC_NO_CONSOLE, m_NoConsole);
-       DDX_Control(pDX, IDC_LOOP, m_Loop);
-       DDX_Control(pDX, IDC_SINGLE_INSTANCE, m_SingleInstance);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptGen, CDialog)
-       //{{AFX_MSG_MAP(COptGen)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptGen message handlers
-
-
-
-BOOL COptGen::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-
-       Osmo4 *gpac = GetApp();
-       const char *sOpt;
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "Loop");
-       m_Loop.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "LookForSubtitles");
-       m_LookForSubs.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "ConsoleOff");
-       m_NoConsole.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "ViewXMT");
-       m_ViewXMT.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "SingleInstance");
-       m_SingleInstance.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       return TRUE; 
-}
-
-void COptGen::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-
-       gpac->m_Loop = m_Loop.GetCheck();
-       gf_cfg_set_key(gpac->m_user.config, "General", "Loop", gpac->m_Loop ? "yes" : "no");
-       gpac->m_LookForSubtitles = m_LookForSubs.GetCheck();
-       gf_cfg_set_key(gpac->m_user.config, "General", "LookForSubtitles",  gpac->m_LookForSubtitles ? "yes" : "no");
-       gpac->m_NoConsole = m_NoConsole.GetCheck();
-       gf_cfg_set_key(gpac->m_user.config, "General", "ConsoleOff", gpac->m_NoConsole ? "yes" : "no");
-       gpac->m_ViewXMTA = m_ViewXMT.GetCheck();
-       gf_cfg_set_key(gpac->m_user.config, "General", "ViewXMT", gpac->m_ViewXMTA ? "yes" : "no");
-       gpac->m_SingleInstance = m_SingleInstance.GetCheck();
-       gf_cfg_set_key(gpac->m_user.config, "General", "SingleInstance", gpac->m_SingleInstance ? "yes" : "no");
-}
-
-COptSystems::COptSystems(CWnd* pParent /*=NULL*/)
-       : CDialog(COptSystems::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptSystems)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void COptSystems::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptSystems)
-       DDX_Control(pDX, IDC_FORCE_DURATION, m_ForceDuration);
-       DDX_Control(pDX, IDC_DEC_THREAD, m_Threading);
-       DDX_Control(pDX, IDC_BIFSDROP, m_BifsAlwaysDrawn);
-       DDX_Control(pDX, IDC_LANG, m_Lang);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptSystems, CDialog)
-       //{{AFX_MSG_MAP(COptSystems)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptSystems message handlers
-
-
-
-
-
-BOOL COptSystems::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-       Osmo4 *gpac = GetApp();
-       const char *sOpt;
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "Language3CC");
-       if (!sOpt) sOpt = "eng";
-       s32 select = 0;
-       while (m_Lang.GetCount()) m_Lang.DeleteString(0);
-       s32 i = 0;
-       while (GF_ISO639_Lang[i]) {
-               /*only use common languages (having both 2- and 3-char code names)*/
-               if (GF_ISO639_Lang[i+2][0]) {
-                       m_Lang.AddString(GF_ISO639_Lang[i]);
-                       if (sOpt && !stricmp(sOpt, GF_ISO639_Lang[i+1])) select = m_Lang.GetCount() - 1;
-               }
-               i += 3;
-       }
-       m_Lang.SetCurSel(select);
-
-       
-       /*system config*/
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "ThreadingPolicy");
-       select = 0;
-       while (m_Threading.GetCount()) m_Threading.DeleteString(0);
-       m_Threading.AddString("Single Thread");
-       m_Threading.AddString("Mutli Thread");
-       if (sOpt && !stricmp(sOpt, "Multi")) select = 1;
-       m_Threading.AddString("Free");
-       if (sOpt && !stricmp(sOpt, "Free")) select = 2;
-       m_Threading.SetCurSel(select);
-
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "ForceSingleClock");
-       if (sOpt && !stricmp(sOpt, "yes")) {
-               m_ForceDuration.SetCheck(1);
-       } else {
-               m_ForceDuration.SetCheck(0);
-       }
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "AlwaysDrawBIFS");
-       if (sOpt && !stricmp(sOpt, "yes")) {
-               m_BifsAlwaysDrawn.SetCheck(1);
-       } else {
-               m_BifsAlwaysDrawn.SetCheck(0);
-       }
-
-       
-       return TRUE; 
-}
-
-
-void COptSystems::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-
-       s32 sel = m_Lang.GetCurSel();
-       u32 i=0;
-       while (GF_ISO639_Lang[i]) {
-               /*only use common languages (having both 2- and 3-char code names)*/
-               if (GF_ISO639_Lang[i+2][0]) {
-                       if (!sel) break;
-                       sel--;
-               }
-               i+=3;
-       }
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "LanguageName", GF_ISO639_Lang[i]);
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "Language3CC", GF_ISO639_Lang[i+1]);
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "Language2CC", GF_ISO639_Lang[i+2]);
-
-       sel = m_Threading.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "ThreadingPolicy", (sel==0) ? "Single" : ( (sel==1) ? "Multi" : "Free"));
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "ForceSingleClock", m_ForceDuration.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "AlwaysDrawBIFS", m_BifsAlwaysDrawn.GetCheck() ? "yes" : "no");
-}
-
-
-OptDecoder::OptDecoder(CWnd* pParent /*=NULL*/)
-       : CDialog(OptDecoder::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(OptDecoder)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void OptDecoder::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(OptDecoder)
-       DDX_Control(pDX, IDC_VIDEC_LIST, m_Video);
-       DDX_Control(pDX, IDC_AUDEC_LIST, m_Audio);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(OptDecoder, CDialog)
-       //{{AFX_MSG_MAP(OptDecoder)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// OptDecoder message handlers
-
-
-
-BOOL OptDecoder::OnInitDialog() 
-{
-       u32 i;
-       const char *sOpt;
-       CDialog::OnInitDialog();
-       
-       Osmo4 *gpac = GetApp();
-       
-       /*audio dec enum*/
-       while (m_Audio.GetCount()) m_Audio.DeleteString(0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "DefAudioDec");
-       u32 count = gf_modules_get_count(gpac->m_user.modules);
-       GF_BaseDecoder *ifce;
-       s32 select = 0;
-       s32 to_sel = 0;
-       for (i=0; i<count; i++) {
-               ifce = (GF_BaseDecoder *) gf_modules_load_interface(gpac->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
-               if (!ifce) continue;
-
-               if (ifce->CanHandleStream(ifce, GF_STREAM_AUDIO, NULL, 0)) {
-                       if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
-                       m_Audio.AddString(ifce->module_name);
-                       to_sel++;
-               }
-               gf_modules_close_interface((GF_BaseInterface *)ifce);
-       }
-       m_Audio.SetCurSel(select);
-
-       /*video dec enum*/
-       while (m_Video.GetCount()) m_Video.DeleteString(0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "DefVideoDec");
-       count = gf_modules_get_count(gpac->m_user.modules);
-       select = 0;
-       to_sel = 0;
-       for (i=0; i<count; i++) {
-               ifce = (GF_BaseDecoder *) gf_modules_load_interface(gpac->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
-               if (!ifce) continue;
-
-               if (ifce->CanHandleStream(ifce, GF_STREAM_VISUAL, NULL, 0)) {
-                       if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
-                       m_Video.AddString(ifce->module_name);
-                       to_sel++;
-               }
-               gf_modules_close_interface((GF_BaseInterface *)ifce);
-       }
-       m_Video.SetCurSel(select);
-       return TRUE;  
-}
-
-void OptDecoder::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-       char str[100];
-       m_Audio.GetWindowText(str, 100);
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "DefAudioDec", str);
-       m_Video.GetWindowText(str, 100);
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "DefVideoDec", str);
-
-}
-
-COptRender::COptRender(CWnd* pParent /*=NULL*/)
-       : CDialog(COptRender::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptRender)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptRender::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptRender)
-       DDX_Control(pDX, IDC_DRAW_BOUNDS, m_DrawBounds);
-       DDX_Control(pDX, IDC_GD_LIST, m_Graphics);
-       DDX_Control(pDX, IDC_USE_RENDER3D, m_Use3DRender);
-       DDX_Control(pDX, IDC_AA_LIST, m_AntiAlias);
-       DDX_Control(pDX, IDC_FORCE_SIZE, m_ForceSize);
-       DDX_Control(pDX, IDC_FAST_RENDER, m_HighSpeed);
-       DDX_Control(pDX, IDC_BIFS_RATE, m_BIFSRate);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptRender, CDialog)
-       //{{AFX_MSG_MAP(COptRender)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptRender message handlers
-
-
-
-#define NUM_RATES 11
-static char *BIFSRates[11] = 
-{
-       "5.0",
-       "7.5",
-       "10.0",
-       "12.5",
-       "15.0",
-       "24.0",
-       "25.0",
-       "30.0",
-       "50.0",
-       "60.0",
-       "100.0",
-};
-
-
-
-BOOL COptRender::OnInitDialog() 
-{
-       s32 i;
-       CDialog::OnInitDialog();
-       
-       Osmo4 *gpac = GetApp();
-       const char *sOpt;
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "ForceOpenGL");
-       m_Use3DRender.SetCheck( (sOpt && !strcmp(sOpt, "yes")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "ForceSceneSize");
-       m_ForceSize.SetCheck( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "FrameRate");
-       if (!sOpt) sOpt = "30.0";
-       s32 select = 0;
-       while (m_BIFSRate.GetCount()) m_BIFSRate.DeleteString(0);
-       for (i = 0; i<NUM_RATES; i++) {
-               m_BIFSRate.AddString(BIFSRates[i]);
-               if (sOpt && !stricmp(sOpt, BIFSRates[i]) ) select = i;
-       }
-       m_BIFSRate.SetCurSel(select);
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "HighSpeed");
-       m_HighSpeed.SetCheck( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "AntiAlias");
-       while (m_AntiAlias.GetCount()) m_AntiAlias.DeleteString(0);
-
-       m_AntiAlias.AddString("None");
-       m_AntiAlias.AddString("Text only");
-       m_AntiAlias.AddString("Complete");
-       select = 2;
-       if (sOpt && !stricmp(sOpt, "Text")) select = 1;
-       else if (sOpt && !stricmp(sOpt, "None")) select = 0;
-       m_AntiAlias.SetCurSel(select);
-
-       /*graphics driver enum*/
-       while (m_Graphics.GetCount()) m_Graphics.DeleteString(0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "Raster2D");
-       s32 count = gf_modules_get_count(gpac->m_user.modules);
-       GF_BaseInterface *ifce;
-       select = 0;
-       u32 to_sel = 0;
-       for (i=0; i<count; i++) {
-               ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_RASTER_2D_INTERFACE);
-               if (!ifce) continue;
-               if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
-               m_Graphics.AddString(ifce->module_name);
-               gf_modules_close_interface(ifce);
-               to_sel++;
-       }
-       m_Graphics.SetCurSel(select);
-
-
-       m_DrawBounds.AddString("None");
-       m_DrawBounds.AddString("Box/Rect");
-       m_DrawBounds.AddString("AABB Tree");
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "BoundingVolume");
-       if (sOpt && !stricmp(sOpt, "Box")) m_DrawBounds.SetCurSel(1);
-       else if (sOpt && !stricmp(sOpt, "AABB")) m_DrawBounds.SetCurSel(2);
-       else m_DrawBounds.SetCurSel(0);
-
-       return TRUE;  
-}
-
-
-Bool COptRender::SaveOptions()
-{
-       char str[50];
-       Osmo4 *gpac = GetApp();
-
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "HighSpeed", m_HighSpeed.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "ForceSceneSize", m_ForceSize.GetCheck() ? "yes" : "no");
-
-       s32 sel = m_BIFSRate.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "FrameRate", BIFSRates[sel]);
-
-       sel = m_AntiAlias.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "AntiAlias", (sel==0) ? "None" : ( (sel==1) ? "Text" : "All"));
-
-       sel = m_DrawBounds.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "BoundingVolume", (sel==2) ? "AABB" : (sel==1) ? "Box" : "None");
-
-       m_Graphics.GetWindowText(str, 50);
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "Raster2D", str);
-
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "ForceOpenGL", m_Use3DRender.GetCheck() ? "yes" : "no");
-       return 0;
-}
-
-
-COptRender2D::COptRender2D(CWnd* pParent /*=NULL*/)
-       : CDialog(COptRender2D::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptRender2D)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void COptRender2D::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptRender2D)
-       DDX_Control(pDX, IDC_FORMAT_YUV, m_YUVFormat);
-       DDX_Control(pDX, IDC_YUV, m_NoYUV);
-       DDX_Control(pDX, IDC_ZOOM_SCALABLE, m_Scalable);
-       DDX_Control(pDX, IDC_DIRECTRENDER, m_DirectRender);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptRender2D, CDialog)
-       //{{AFX_MSG_MAP(COptRender2D)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptRender2D message handlers
-
-BOOL COptRender2D::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-       Osmo4 *gpac = GetApp();
-       const char *sOpt;
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DrawMode");
-       if (sOpt && !stricmp(sOpt, "immediate")) {
-               m_DirectRender.SetCheck(1);
-       } else {
-               m_DirectRender.SetCheck(0);
-       }
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "ScalableZoom");
-       if (sOpt && !stricmp(sOpt, "no")) {
-               m_Scalable.SetCheck(0);
-       } else {
-               m_Scalable.SetCheck(1);
-       }
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DisableYUV");
-       if (sOpt && !stricmp(sOpt, "yes")) {
-               m_NoYUV.SetCheck(1);
-       } else {
-               m_NoYUV.SetCheck(0);
-       }
-       
-       SetYUV();
-
-       return TRUE;  // return TRUE unless you set the focus to a control
-                     // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void COptRender2D::SetYUV()
-{
-       Osmo4 *gpac = GetApp();
-       u32 yuv_format = gf_term_get_option(gpac->m_term, GF_OPT_YUV_FORMAT);
-       if (!yuv_format) {
-               m_YUVFormat.SetWindowText("(No YUV used)");
-       } else {
-               char str[100];
-               sprintf(str, "(%s used)", gf_4cc_to_str(yuv_format));
-               m_YUVFormat.SetWindowText(str);
-       }
-}
-
-void COptRender2D::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "DrawMode", m_DirectRender.GetCheck() ? "immediate" : "defer");
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "ScalableZoom", m_Scalable.GetCheck() ? "yes" : "no");
-
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "DisableYUV", m_NoYUV.GetCheck() ? "yes" : "no");
-}
-
-
-COptRender3D::COptRender3D(CWnd* pParent /*=NULL*/)
-       : CDialog(COptRender3D::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptRender3D)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptRender3D::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptRender3D)
-       DDX_Control(pDX, IDC_BITMAP_USE_PIXEL, m_BitmapPixels);
-       DDX_Control(pDX, IDC_DISABLE_TX_RECT, m_DisableTXRect);
-       DDX_Control(pDX, IDC_RASTER_OUTLINE, m_RasterOutlines);
-       DDX_Control(pDX, IDC_EMUL_POW2, m_EmulPow2);
-       DDX_Control(pDX, IDC_DISABLE_POLY_AA, m_PolyAA);
-       DDX_Control(pDX, IDC_DRAW_NORMALS, m_DrawNormals);
-       DDX_Control(pDX, IDC_BACK_CULL, m_BackCull);
-       DDX_Control(pDX, IDC_DRAW_MODE, m_Wireframe);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptRender3D, CDialog)
-       //{{AFX_MSG_MAP(COptRender3D)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptRender3D message handlers
-
-
-BOOL COptRender3D::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-
-       Osmo4 *gpac = GetApp();
-       const char *sOpt;
-
-       m_DrawNormals.AddString("Never");
-       m_DrawNormals.AddString("Per Face");
-       m_DrawNormals.AddString("Per Vertex");
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DrawNormals");
-       if (sOpt && !stricmp(sOpt, "PerFace")) m_DrawNormals.SetCurSel(1);
-       else if (sOpt && !stricmp(sOpt, "PerVertex")) m_DrawNormals.SetCurSel(2);
-       else m_DrawNormals.SetCurSel(0);
-
-       m_BackCull.AddString("Off");
-       m_BackCull.AddString("On");
-       m_BackCull.AddString("Alpha");
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "BackFaceCulling");
-       if (sOpt && !stricmp(sOpt, "Off")) m_BackCull.SetCurSel(0);
-       else if (sOpt && !stricmp(sOpt, "Alpha")) m_BackCull.SetCurSel(2);
-       else m_BackCull.SetCurSel(1);
-
-       m_Wireframe.AddString("Solid");
-       m_Wireframe.AddString("Wireframe");
-       m_Wireframe.AddString("Both");
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "Wireframe");
-       if (sOpt && !stricmp(sOpt, "WireOnly")) m_Wireframe.SetCurSel(1);
-       else if (sOpt && !stricmp(sOpt, "WireOnSolid")) m_Wireframe.SetCurSel(2);
-       else m_Wireframe.SetCurSel(0);
-       
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "RasterOutlines");
-       m_RasterOutlines.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "EmulatePOW2");
-       m_EmulPow2.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "PolygonAA");
-       m_PolyAA.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "BitmapCopyPixels");
-       m_BitmapPixels.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DisableRectExt");
-       m_DisableTXRect.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       return TRUE;  // return TRUE unless you set the focus to a control
-                     // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void COptRender3D::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-
-       u32 sel = m_DrawNormals.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "DrawNormals", (sel==2) ? "PerVertex" : (sel==1) ? "PerFace" : "Never");
-       sel = m_BackCull.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "BackFaceCulling", (sel==2) ? "Alpha" : (sel==1) ? "On" : "Off");
-       sel = m_Wireframe.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "Wireframe", (sel==2) ? "WireOnSolid" : (sel==1) ? "WireOnly" : "WireNone");
-
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "RasterOutlines", m_RasterOutlines.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "EmulatePOW2", m_EmulPow2.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "PolygonAA", m_PolyAA.GetCheck() ? "yes" : "no");
-
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "DisableRectExt", m_DisableTXRect.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "BitmapCopyPixels", m_BitmapPixels.GetCheck() ? "yes" : "no");
-}
-
-COptVideo::COptVideo(CWnd* pParent /*=NULL*/)
-       : CDialog(COptVideo::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptVideo)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptVideo::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptVideo)
-       DDX_Control(pDX, IDC_SWITCH_RES, m_SwitchRes);
-       DDX_Control(pDX, IDC_VIDEO_LIST, m_Videos);
-       DDX_Control(pDX, IDC_HWMEMORY, m_UseHWMemory);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptVideo, CDialog)
-       //{{AFX_MSG_MAP(COptVideo)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptVideo message handlers
-
-BOOL COptVideo::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-
-       Osmo4 *gpac = GetApp();
-       const char *sOpt;
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Video", "SwitchResolution");
-       m_SwitchRes.SetCheck(sOpt && !stricmp(sOpt, "yes") ? 1 : 0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Video", "HardwareMemory");
-       m_UseHWMemory.SetCheck(sOpt && !stricmp(sOpt, "Always") ? 1 : 0);
-       
-       
-       u32 count = gf_modules_get_count(gpac->m_user.modules);
-       GF_BaseInterface *ifce;
-       s32 to_sel = 0;
-       s32 select = 0;
-       /*video drivers enum*/
-       while (m_Videos.GetCount()) m_Videos.DeleteString(0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Video", "DriverName");
-
-       for (u32 i=0; i<count; i++) {
-               ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_VIDEO_OUTPUT_INTERFACE);
-               if (!ifce) continue;
-               if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
-               m_Videos.AddString(ifce->module_name);
-               gf_modules_close_interface(ifce);
-               to_sel++;
-       }
-       m_Videos.SetCurSel(select);
-
-       return TRUE;
-                   
-}
-
-void COptVideo::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-       char str[50];
-
-       gf_cfg_set_key(gpac->m_user.config, "Video", "SwitchResolution", m_SwitchRes.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Video", "HardwareMemory", m_UseHWMemory.GetCheck() ? "Always" : "Auto");
-       m_Videos.GetWindowText(str, 50);
-       gf_cfg_set_key(gpac->m_user.config, "Video", "DriverName", str);
-}
-
-
-COptAudio::COptAudio(CWnd* pParent /*=NULL*/)
-       : CDialog(COptAudio::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptAudio)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptAudio::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptAudio)
-       DDX_Control(pDX, IDC_AUDIO_NOTIFS, m_Notifs);
-       DDX_Control(pDX, IDC_DRIVER_LIST, m_DriverList);
-       DDX_Control(pDX, IDC_AUDIO_RESYNC, m_AudioResync);
-       DDX_Control(pDX, IDC_AUDIO_MULTICH, m_AudioMultiCH);
-       DDX_Control(pDX, IDC_AUDIO_FPS, m_AudioDur);
-       DDX_Control(pDX, IDC_SPIN_FPS, m_SpinFPS);
-       DDX_Control(pDX, IDC_FORCE_AUDIO, m_ForceConfig);
-       DDX_Control(pDX, IDC_SPIN_AUDIO, m_AudioSpin);
-       DDX_Control(pDX, IDC_EDIT_AUDIO, m_AudioEdit);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptAudio, CDialog)
-       //{{AFX_MSG_MAP(COptAudio)
-       ON_BN_CLICKED(IDC_FORCE_AUDIO, OnForceAudio)
-       ON_CBN_SELCHANGE(IDC_DRIVER_LIST, OnSelchangeDriverList)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptAudio message handlers
-
-BOOL COptAudio::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-
-       m_AudioSpin.SetBuddy(& m_AudioEdit);
-       m_SpinFPS.SetBuddy(& m_AudioDur);
-       m_SpinFPS.SetRange(0, 2000);
-
-       Osmo4 *gpac = GetApp();
-       const char *sOpt;
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "ForceConfig");
-       if (sOpt && !stricmp(sOpt, "yes")) {
-               m_ForceConfig.SetCheck(1);
-       } else {
-               m_ForceConfig.SetCheck(0);
-       }
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "NumBuffers");
-       if (sOpt) {
-               m_AudioEdit.SetWindowText(sOpt);
-       } else {
-               m_AudioEdit.SetWindowText("2");
-       }
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "TotalDuration");
-       if (sOpt) {
-               m_AudioDur.SetWindowText(sOpt);
-       } else {
-               m_AudioDur.SetWindowText("120");
-       }
-
-       OnForceAudio();
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "NoResync");
-       m_AudioResync.SetCheck( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "DisableMultiChannel");
-       m_AudioMultiCH.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       
-       /*driver enum*/
-       while (m_DriverList.GetCount()) m_DriverList.DeleteString(0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "DriverName");
-       u32 count = gf_modules_get_count(gpac->m_user.modules);
-       GF_BaseInterface *ifce;
-       s32 select = 0;
-       s32 to_sel = 0;
-       for (u32 i=0; i<count; i++) {
-               ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_AUDIO_OUTPUT_INTERFACE);
-               if (!ifce) continue;
-               if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
-               m_DriverList.AddString(ifce->module_name);
-               gf_modules_close_interface(ifce);
-               to_sel++;
-       }
-       m_DriverList.SetCurSel(select);
-
-       m_Notifs.ShowWindow(SW_HIDE);
-       if (sOpt && strstr(sOpt, "DirectSound")) m_Notifs.ShowWindow(SW_SHOW);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "DisableNotification");
-       if (sOpt && !stricmp(sOpt, "yes")) 
-               m_Notifs.SetCheck(1);
-       else
-               m_Notifs.SetCheck(0);
-
-       return TRUE;  
-}
-
-
-void COptAudio::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-       char str[50];
-
-       gf_cfg_set_key(gpac->m_user.config, "Audio", "ForceConfig", m_ForceConfig.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Audio", "NoResync", m_AudioResync.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Audio", "DisableMultiChannel", m_AudioMultiCH.GetCheck() ? "yes" : "no");
-
-       m_AudioEdit.GetWindowText(str, 20);
-       gf_cfg_set_key(gpac->m_user.config, "Audio", "NumBuffers", str);
-       m_AudioDur.GetWindowText(str, 20);
-       gf_cfg_set_key(gpac->m_user.config, "Audio", "TotalDuration", str);
-
-       m_DriverList.GetWindowText(str, 50);
-       gf_cfg_set_key(gpac->m_user.config, "Audio", "DriverName", str);
-
-       if (strstr(str, "DirectSound")) {
-               gf_cfg_set_key(gpac->m_user.config, "Audio", "DisableNotification", m_Notifs.GetCheck() ? "yes" : "no");
-       }
-
-}
-
-void COptAudio::OnForceAudio() 
-{
-       BOOL en = m_ForceConfig.GetCheck();
-
-       m_AudioSpin.EnableWindow(en);
-       m_AudioEdit.EnableWindow(en);
-       m_SpinFPS.EnableWindow(en);
-       m_AudioDur.EnableWindow(en);
-}
-
-void COptAudio::OnSelchangeDriverList() 
-{
-       char str[50];
-       m_DriverList.GetWindowText(str, 50);
-       if (strstr(str, "DirectSound")) {
-               m_Notifs.ShowWindow(SW_SHOW);
-       } else {
-               m_Notifs.ShowWindow(SW_HIDE);
-       }
-}
-
-
-
-
-COptFont::COptFont(CWnd* pParent /*=NULL*/)
-       : CDialog(COptFont::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptFont)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptFont::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptFont)
-       DDX_Control(pDX, IDC_TEXTURE_MODE, m_TextureModes);
-       DDX_Control(pDX, IDC_FONT_LIST, m_Fonts);
-       DDX_Control(pDX, IDC_BROWSE_FONT, m_BrowseFont);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptFont, CDialog)
-       //{{AFX_MSG_MAP(COptFont)
-       ON_BN_CLICKED(IDC_BROWSE_FONT, OnBrowseFont)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptFont message handlers
-
-BOOL COptFont::OnInitDialog() 
-{
-       u32 i;
-       GF_BaseInterface *ifce;
-       
-       CDialog::OnInitDialog();
-       
-       Osmo4 *gpac = GetApp();
-       const char *sOpt;
-
-       /*video drivers enum*/
-       while (m_Fonts.GetCount()) m_Fonts.DeleteString(0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "FontEngine", "FontReader");
-       s32 to_sel = 0;
-       s32 select = 0;
-       u32 count = gf_modules_get_count(gpac->m_user.modules);
-       for (i=0; i<count; i++) {
-               ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_FONT_READER_INTERFACE);
-               if (!ifce) continue;
-               if (sOpt && !stricmp(ifce->module_name, sOpt)) select = to_sel;
-               m_Fonts.AddString(ifce->module_name);
-               gf_modules_close_interface(ifce);
-               to_sel++;
-       }
-       m_Fonts.SetCurSel(select);
-       
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "FontEngine", "FontDirectory");
-       if (sOpt) m_BrowseFont.SetWindowText(sOpt);
-
-       /*text texturing modes*/
-       while (m_TextureModes.GetCount()) m_TextureModes.DeleteString(0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "TextureTextMode");
-       m_TextureModes.AddString("Default");
-       m_TextureModes.AddString("Never");
-       m_TextureModes.AddString("Always");
-       if (sOpt && !stricmp(sOpt, "3D")) m_TextureModes.SetCurSel(1);
-       else if (sOpt && !stricmp(sOpt, "Always")) m_TextureModes.SetCurSel(2);
-       else m_TextureModes.SetCurSel(0);
-
-       return TRUE;  
-}
-
-
-
-static char szCacheDir[MAX_PATH];
-
-static int CALLBACK LocCbck(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData) 
-{
-       char dir[MAX_PATH];
-       if (uMsg == BFFM_INITIALIZED) {
-               strcpy(dir, szCacheDir);
-               SendMessage(hwnd, BFFM_SETSELECTION, TRUE,(LPARAM) dir);
-       }
-       return 0;
-}
-
-void COptFont::OnBrowseFont() 
-{
-       BROWSEINFO brw;
-       LPMALLOC pMalloc;
-       LPITEMIDLIST ret;
-       char dir[MAX_PATH];
-
-       if (NOERROR == ::SHGetMalloc(&pMalloc) ) {
-
-               m_BrowseFont.GetWindowText(szCacheDir, MAX_PATH);
-
-               memset(&brw, 0, sizeof(BROWSEINFO));
-               brw.hwndOwner = this->GetSafeHwnd();
-               brw.pszDisplayName = dir;
-               brw.lpszTitle = "Select Font Directory...";
-               brw.ulFlags = 0L;
-               brw.lpfn = LocCbck;
-
-               ret = SHBrowseForFolder(&brw);
-               if (ret != NULL) {
-                       if (::SHGetPathFromIDList(ret, dir)) {
-                               m_BrowseFont.SetWindowText(dir);
-                       }
-                       pMalloc->Free(ret);
-               }
-               pMalloc->Release();
-       }
-}
-
-
-void COptFont::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-       char str[MAX_PATH];
-               
-       m_Fonts.GetWindowText(str, 50);
-       gf_cfg_set_key(gpac->m_user.config, "FontEngine", "FontReader", str);
-       m_BrowseFont.GetWindowText(str, 50);
-       gf_cfg_set_key(gpac->m_user.config, "FontEngine", "FontDirectory", str);
-       switch (m_TextureModes.GetCurSel()) {
-       case 2: gf_cfg_set_key(gpac->m_user.config, "Compositor", "TextureTextMode", "Always"); break;
-       case 1: gf_cfg_set_key(gpac->m_user.config, "Compositor", "TextureTextMode", "Never"); break;
-       default: gf_cfg_set_key(gpac->m_user.config, "Compositor", "TextureTextMode", "Default"); break;
-       }
-}
-
-
-COptHTTP::COptHTTP(CWnd* pParent /*=NULL*/)
-       : CDialog(COptHTTP::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptHTTP)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptHTTP::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptHTTP)
-       DDX_Control(pDX, IDC_HTTP_PROXY, m_ProxyName);
-       DDX_Control(pDX, IDC_HTTP_USE_PROXY, m_useProxy);
-       DDX_Control(pDX, IDC_SAX_DELAY, m_SAXDuration);
-       DDX_Control(pDX, IDC_SAX_PROGRESSIVE, m_Progressive);
-       DDX_Control(pDX, IDC_RESTART_CACHE, m_DisableCache);
-       DDX_Control(pDX, IDC_CLEAN_CACHE, m_CleanCache);
-       DDX_Control(pDX, IDC_BROWSE_CACHE, m_CacheDir);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptHTTP, CDialog)
-       //{{AFX_MSG_MAP(COptHTTP)
-       ON_BN_CLICKED(IDC_BROWSE_CACHE, OnBrowseCache)
-       ON_BN_CLICKED(IDC_SAX_PROGRESSIVE, OnSaxProgressive)
-       ON_BN_CLICKED(IDC_HTTP_USE_PROXY, OnUseProxy)
-       //}}AFX_MSG_MAP
-       ON_BN_CLICKED(IDC_RESTART_CACHE, &COptHTTP::OnBnClickedRestartCache)
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptHTTP message handlers
-
-
-void COptHTTP::OnBrowseCache() 
-{
-       BROWSEINFO brw;
-       LPMALLOC pMalloc;
-       LPITEMIDLIST ret;
-       char dir[MAX_PATH];
-
-       if (NOERROR == ::SHGetMalloc(&pMalloc) ) {
-
-               m_CacheDir.GetWindowText(szCacheDir, MAX_PATH);
-
-               memset(&brw, 0, sizeof(BROWSEINFO));
-               brw.hwndOwner = this->GetSafeHwnd();
-               brw.pszDisplayName = dir;
-               brw.lpszTitle = "Select HTTP Cache Directory...";
-               brw.ulFlags = 0L;
-               brw.lpfn = LocCbck;
-
-               ret = SHBrowseForFolder(&brw);
-               if (ret != NULL) {
-                       if (::SHGetPathFromIDList(ret, dir)) {
-                               m_CacheDir.SetWindowText(dir);
-                       }
-                       pMalloc->Free(ret);
-               }
-               pMalloc->Release();
-       }
-}
-
-BOOL COptHTTP::OnInitDialog() 
-{
-       char proxy[GF_MAX_PATH];
-       CDialog::OnInitDialog();
-       
-       Osmo4 *gpac = GetApp();
-       const char *sOpt;
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "CacheDirectory");
-       if (sOpt) m_CacheDir.SetWindowText(sOpt);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Downloader", "CleanCache");
-       m_CleanCache.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Downloader", "DisableCache");
-       m_DisableCache.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "SAXLoader", "Progressive");
-       m_Progressive.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       OnSaxProgressive();
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "SAXLoader", "MaxDuration");
-       if (sOpt) {
-               m_SAXDuration.SetWindowText(sOpt);
-       } else {
-               m_SAXDuration.SetWindowText("0");
-       }
-       //if (m_Progressive.GetCheck()) m_SAXDuration.EnableWindow(1);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "HTTPProxy", "Enabled");
-       m_useProxy.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       OnUseProxy();
-       strcpy(proxy, "");
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "HTTPProxy", "Name");
-       if (sOpt) {
-               strcpy(proxy, sOpt);
-               sOpt = gf_cfg_get_key(gpac->m_user.config, "HTTPProxy", "Port");
-               if (sOpt) {
-                       strcat(proxy, ":");
-                       strcat(proxy, sOpt);
-               }
-       }
-       m_ProxyName.SetWindowText(proxy);
-       return TRUE; 
-}
-
-void COptHTTP::OnSaxProgressive() 
-{
-       if (m_Progressive.GetCheck()) {
-               m_SAXDuration.EnableWindow(1);
-       } else {
-               m_SAXDuration.EnableWindow(0);
-       }
-}
-
-
-void COptHTTP::OnUseProxy() 
-{
-       if (m_useProxy.GetCheck()) {
-               m_ProxyName.EnableWindow(1);
-       } else {
-               m_ProxyName.EnableWindow(0);
-       }
-}
-
-void COptHTTP::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-
-       gf_cfg_set_key(gpac->m_user.config, "Downloader", "CleanCache", m_CleanCache.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Downloader", "DisableCache", m_DisableCache.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "SAXLoader", "Progressive", m_Progressive.GetCheck() ? "yes" : "no");
-
-       m_SAXDuration.GetWindowText(szCacheDir, MAX_PATH);
-       gf_cfg_set_key(gpac->m_user.config, "SAXLoader", "MaxDuration", szCacheDir);
-
-       gf_cfg_set_key(gpac->m_user.config, "HTTPProxy", "Enabled", m_useProxy.GetCheck() ? "yes" : "no");
-       m_ProxyName.GetWindowText(szCacheDir, MAX_PATH);
-       char *sep = strrchr(szCacheDir, ':');
-       if (sep) {
-               sep[0] = 0;
-               gf_cfg_set_key(gpac->m_user.config, "HTTPProxy", "Name", szCacheDir);
-               sep[0] = ':';
-               gf_cfg_set_key(gpac->m_user.config, "HTTPProxy", "Port", sep+1);
-       } else {
-               gf_cfg_set_key(gpac->m_user.config, "HTTPProxy", "Name", szCacheDir);
-               gf_cfg_set_key(gpac->m_user.config, "HTTPProxy", "Port", NULL);
-       }
-       m_CacheDir.GetWindowText(szCacheDir, MAX_PATH);
-       gf_cfg_set_key(gpac->m_user.config, "General", "CacheDirectory", szCacheDir);
-}
-
-
-COptStream::COptStream(CWnd* pParent /*=NULL*/)
-       : CDialog(COptStream::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptStream)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptStream::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptStream)
-       DDX_Control(pDX, IDC_REBUFFER_LEN, m_RebufferLen);
-       DDX_Control(pDX, IDC_REBUFFER, m_Rebuffer);
-       DDX_Control(pDX, IDC_BUFFER, m_Buffer);
-       DDX_Control(pDX, IDC_TIMEOUT, m_Timeout);
-       DDX_Control(pDX, IDC_REORDER, m_Reorder);
-       DDX_Control(pDX, IDC_RTSP, m_UseRTSP);
-       DDX_Control(pDX, IDC_PORT, m_Port);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptStream, CDialog)
-       //{{AFX_MSG_MAP(COptStream)
-       ON_CBN_SELCHANGE(IDC_PORT, OnSelchangePort)
-       ON_BN_CLICKED(IDC_RTSP, OnRtsp)
-       ON_BN_CLICKED(IDC_REBUFFER, OnRebuffer)
-       ON_EN_UPDATE(IDC_REBUFFER_LEN, OnUpdateRebufferLen)
-       ON_EN_UPDATE(IDC_BUFFER, OnUpdateBuffer)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptStream message handlers
-
-BOOL COptStream::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-
-       Osmo4 *gpac = GetApp();
-       const char *sOpt;
-
-       while (m_Port.GetCount()) m_Port.DeleteString(0);
-       m_Port.AddString("554 (RTSP standard)");
-       m_Port.AddString("7070 (RTSP ext)");
-       m_Port.AddString("80 (RTSP / HTTP tunnel)");
-       m_Port.AddString("8080 (RTSP / HTTP tunnel)");
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "DefaultPort");
-       u32 port = 554;
-       Bool force_rtsp = 0;;
-       if (sOpt) port = atoi(sOpt);
-       switch (port) {
-       case 8080:
-               m_Port.SetCurSel(3);
-               force_rtsp = 1;
-               break;
-       case 80:
-               m_Port.SetCurSel(2);
-               force_rtsp = 1;
-               break;
-       case 7070:
-               m_Port.SetCurSel(1);
-               break;
-       default:
-               m_Port.SetCurSel(0);
-               break;
-       }
-
-       Bool use_rtsp = 0;
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "RTPoverRTSP");
-       if (sOpt && !stricmp(sOpt, "yes")) use_rtsp = 1;
-
-       if (force_rtsp) {
-               m_UseRTSP.SetCheck(1);
-               m_UseRTSP.EnableWindow(0);
-               m_Reorder.SetCheck(0);
-               m_Reorder.EnableWindow(0);
-       } else {
-               m_UseRTSP.SetCheck(use_rtsp);
-               m_UseRTSP.EnableWindow(1);
-               m_Reorder.EnableWindow(1);
-               sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "ReorderSize");
-               if (sOpt && !stricmp(sOpt, "0")) {
-                       m_Reorder.SetCheck(0);
-               } else {
-                       m_Reorder.SetCheck(1);
-               }
-       }
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "RTSPTimeout");
-       if (sOpt) {
-               m_Timeout.SetWindowText(sOpt);
-       } else {
-               m_Timeout.SetWindowText("30000");
-       }
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Network", "BufferLength");
-       if (sOpt) {
-               m_Buffer.SetWindowText(sOpt);
-       } else {
-               m_Buffer.SetWindowText("3000");
-       }
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Network", "RebufferLength");
-       u32 buf_len = 0;
-       if (sOpt) buf_len = atoi(sOpt);
-       if (buf_len) {
-               m_RebufferLen.SetWindowText(sOpt);
-               m_Rebuffer.SetCheck(1);
-               m_RebufferLen.EnableWindow(1);
-       } else {
-               m_RebufferLen.SetWindowText("0");
-               m_Rebuffer.SetCheck(0);
-               m_RebufferLen.EnableWindow(0);
-       }
-
-       return TRUE;  
-}
-
-
-void COptStream::OnSelchangePort() 
-{
-       s32 sel = m_Port.GetCurSel();
-       switch (sel) {
-       case 3:
-       case 2:
-               m_UseRTSP.SetCheck(1);
-               m_UseRTSP.EnableWindow(0);
-               m_Reorder.SetCheck(0);
-               m_Reorder.EnableWindow(0);
-               break;
-       case 1:
-       default:
-               m_UseRTSP.SetCheck(0);
-               m_UseRTSP.EnableWindow(1);
-               m_Reorder.SetCheck(1);
-               m_Reorder.EnableWindow(1);
-               break;
-       }
-}
-
-void COptStream::OnRtsp() 
-{
-       if (m_UseRTSP.GetCheck()) {
-               m_Reorder.SetCheck(0);
-               m_Reorder.EnableWindow(0);
-       } else {
-               m_Reorder.SetCheck(1);
-               m_Reorder.EnableWindow(1);
-       }
-       
-}
-
-void COptStream::CheckRebuffer()
-{
-       char str[50];
-       s32 buf, rebuf;
-       m_Buffer.GetWindowText(str, 50);
-       buf = atoi(str);
-       m_RebufferLen.GetWindowText(str, 50);
-       rebuf = atoi(str);
-       if (rebuf*2 > buf) {
-               rebuf = buf/2;
-               sprintf(str, "%d", rebuf);
-               m_RebufferLen.SetWindowText(str);
-       }
-}
-
-void COptStream::OnRebuffer() 
-{
-       if (!m_Rebuffer.GetCheck()) {
-               m_RebufferLen.EnableWindow(0);
-       } else {
-               m_RebufferLen.EnableWindow(1);
-               CheckRebuffer();
-       }
-}
-
-void COptStream::OnUpdateRebufferLen() 
-{
-       CheckRebuffer();
-}
-
-void COptStream::OnUpdateBuffer() 
-{
-       CheckRebuffer();        
-}
-
-void COptStream::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-       Bool force_rtsp = 0;
-       s32 sel = m_Port.GetCurSel();
-       switch (sel) {
-       case 3:
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "8080");
-               force_rtsp = 1;
-               break;
-       case 2:
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "80");
-               force_rtsp = 1;
-               break;
-       case 1:
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "7070");
-               break;
-       default:
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "554");
-               break;
-       }
-
-       if (force_rtsp) {
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTPoverRTSP", "yes");
-       } else {
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTPoverRTSP", m_UseRTSP.GetCheck() ? "yes" : "no");
-               if (!m_UseRTSP.GetCheck()) gf_cfg_set_key(gpac->m_user.config, "Streaming", "ReorderSize", m_Reorder.GetCheck() ? "30" : "0");
-       }
-
-       char str[50];
-
-       m_Timeout.GetWindowText(str, 50);
-       gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTSPTimeout", str);
-
-       m_Buffer.GetWindowText(str, 50);
-       gf_cfg_set_key(gpac->m_user.config, "Network", "BufferLength", str);
-       if (m_Rebuffer.GetCheck()) {
-               m_RebufferLen.GetWindowText(str, 50);
-               gf_cfg_set_key(gpac->m_user.config, "Network", "RebufferLength", str);
-       } else {
-               gf_cfg_set_key(gpac->m_user.config, "Network", "RebufferLength", "0");
-       }
-}
-
-
-
-
-COptMCache::COptMCache(CWnd* pParent /*=NULL*/)
-       : CDialog(COptMCache::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptMCache)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void COptMCache::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptMCache)
-       DDX_Control(pDX, IDC_BASEPRES, m_BaseName);
-       DDX_Control(pDX, IDC_MCACHE_USENAME, m_UseBase);
-       DDX_Control(pDX, IDC_MCACHE_OVERWRITE, m_Overwrite);
-       DDX_Control(pDX, IDC_BROWSE_MCACHE, m_RecDir);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptMCache, CDialog)
-       //{{AFX_MSG_MAP(COptMCache)
-       ON_BN_CLICKED(IDC_BROWSE_MCACHE, OnBrowseMcache)
-       ON_BN_CLICKED(IDC_MCACHE_USENAME, OnMcacheUsename)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptMCache message handlers
-
-void COptMCache::OnBrowseMcache() 
-{
-       BROWSEINFO brw;
-       LPMALLOC pMalloc;
-       LPITEMIDLIST ret;
-       char dir[MAX_PATH];
-
-       if (NOERROR == ::SHGetMalloc(&pMalloc) ) {
-
-               m_RecDir.GetWindowText(szCacheDir, MAX_PATH);
-
-               memset(&brw, 0, sizeof(BROWSEINFO));
-               brw.hwndOwner = this->GetSafeHwnd();
-               brw.pszDisplayName = dir;
-               brw.lpszTitle = "Select HTTP Cache Directory...";
-               brw.ulFlags = 0L;
-               brw.lpfn = LocCbck;
-
-               ret = SHBrowseForFolder(&brw);
-               if (ret != NULL) {
-                       if (::SHGetPathFromIDList(ret, dir)) {
-                               m_RecDir.SetWindowText(dir);
-                       }
-                       pMalloc->Free(ret);
-               }
-               pMalloc->Release();
-       }
-}
-
-BOOL COptMCache::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-       Osmo4 *gpac = GetApp();
-       const char *sOpt;
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "StreamingCache", "RecordDirectory");
-       if (!sOpt) sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "CacheDirectory");
-       if (sOpt) m_RecDir.SetWindowText(sOpt);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "StreamingCache", "KeepExistingFiles");
-       m_Overwrite.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 0 : 1);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "StreamingCache", "BaseFileName");
-       if (sOpt) {
-               m_UseBase.SetCheck(1);
-               m_BaseName.EnableWindow(TRUE);
-               m_BaseName.SetWindowText(sOpt);
-       } else {
-               m_UseBase.SetCheck(0);
-               m_BaseName.EnableWindow(FALSE);
-               m_BaseName.SetWindowText("uses service URL");
-       }
-       return TRUE;
-}
-
-void COptMCache::OnMcacheUsename() 
-{
-       if (m_UseBase.GetCheck()) {
-               m_BaseName.EnableWindow(TRUE);
-               m_BaseName.SetWindowText("record");
-       } else {
-               m_BaseName.EnableWindow(FALSE);
-               m_BaseName.SetWindowText("uses service URL");
-       }
-}
-
-void COptMCache::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-
-       gf_cfg_set_key(gpac->m_user.config, "StreamingCache", "KeepExistingFiles", m_Overwrite.GetCheck() ? "no" : "yes");
-       if (m_UseBase.GetCheck()) {
-               m_BaseName.GetWindowText(szCacheDir, MAX_PATH);
-               gf_cfg_set_key(gpac->m_user.config, "StreamingCache", "BaseFileName", szCacheDir);
-       } else {
-               gf_cfg_set_key(gpac->m_user.config, "StreamingCache", "BaseFileName", NULL);
-       }
-       m_RecDir.GetWindowText(szCacheDir, MAX_PATH);
-       gf_cfg_set_key(gpac->m_user.config, "StreamingCache", "RecordDirectory", szCacheDir);
-}
-
-
-OptFiles::OptFiles(CWnd* pParent /*=NULL*/)
-       : CDialog(OptFiles::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(OptFiles)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void OptFiles::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(OptFiles)
-       DDX_Control(pDX, IDC_ASSOCIATE, m_DoAssociate);
-       DDX_Control(pDX, IDC_FILES_PLUG, m_PlugName);
-       DDX_Control(pDX, IDC_FILES_MIMES, m_mimes);
-       DDX_Control(pDX, IDC_FILES_EXT, m_extensions);
-       DDX_Control(pDX, IDC_FILELIST, m_FileDescs);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(OptFiles, CDialog)
-       //{{AFX_MSG_MAP(OptFiles)
-       ON_CBN_SELCHANGE(IDC_FILELIST, OnSelchangeFilelist)
-       ON_BN_CLICKED(IDC_ASSOCIATE, OnAssociate)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// OptFiles message handlers
-
-BOOL OptFiles::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-       Osmo4 *gpac = GetApp();
-       u32 count, i;
-
-       while (m_FileDescs.GetCount()) m_FileDescs.DeleteString(0);
-       count = gf_cfg_get_key_count(gpac->m_user.config, "MimeTypes");
-       for (i=0; i<count; i++) {
-               char *sMime, *sKey, sDesc[200];
-               const char *sOpt;
-               sMime = (char *) gf_cfg_get_key_name(gpac->m_user.config, "MimeTypes", i);
-               if (!sMime) continue;
-               sOpt = gf_cfg_get_key(gpac->m_user.config, "MimeTypes", sMime);
-               if (!sOpt) continue;
-               sKey = (char *) strstr(sOpt, "\" \"");
-               if (!sKey) continue;
-               strcpy(sDesc, sKey+3);
-               sKey = strchr(sDesc, '\"');
-               if (!sKey) continue;
-               sKey[0] = 0;
-               m_FileDescs.AddString(sDesc);
-       }
-       m_FileDescs.SetCurSel(0);
-       SetSelection(0);
-       return TRUE;
-}
-
-void OptFiles::OnSelchangeFilelist() 
-{
-       SetSelection(m_FileDescs.GetCurSel());
-}
-
-void OptFiles::SetSelection(u32 sel)
-{
-       Osmo4 *gpac = GetApp();
-       char *sMime, *sKey, sDesc[200], sText[200];
-       sMime = (char *) gf_cfg_get_key_name(gpac->m_user.config, "MimeTypes", sel);
-       sprintf(sText, "Mime Type: %s", sMime);
-       m_mimes.SetWindowText(sText);
-       strcpy(cur_mime, sMime);
-       sMime = (char *) gf_cfg_get_key(gpac->m_user.config, "MimeTypes", sMime);
-       strcpy(sDesc, sMime+1);
-       sKey = strchr(sDesc, '\"');
-       sKey[0] = 0;
-       sprintf(sText, "Extensions: %s", sDesc);
-       strcpy(cur_ext, sDesc);
-       m_extensions.SetWindowText(sText);
-       sKey = strrchr(sMime, '\"');
-       sprintf(sText, "Module: %s", sKey+2);
-       m_PlugName.SetWindowText(sText);
-
-       Bool has_asso, need_asso, go = 1;
-       sKey = cur_ext;
-       need_asso = has_asso = 0;
-
-       HKEY hKey;
-       DWORD dwSize;
-       while (go) {
-               Bool ok;
-               char szExt[50], szReg[60], c;
-               char *tmp = strchr(sKey, ' ');
-               if (!tmp) { go = 0;}
-               else { c = tmp[0]; tmp[0] = 0; }
-               sprintf(szExt, ".%s", sKey);
-               sprintf(szReg, "GPAC\\%s", sKey);
-               if (tmp) { tmp[0] = c; tmp += 1; }
-
-               if (RegOpenKeyEx(HKEY_CLASSES_ROOT, szExt, 0, KEY_READ, &hKey ) == ERROR_SUCCESS) {
-                       dwSize = 200;
-                       ok = 1;
-                       if (RegQueryValueEx(hKey, "", NULL, NULL,(unsigned char*) sDesc, &dwSize) != ERROR_SUCCESS) ok = 0;
-                       RegCloseKey(hKey);
-                       if (ok && !stricmp((char *)sDesc, szReg)) has_asso = 1;
-                       else need_asso = 1;
-               } else need_asso = 1;
-               sKey = tmp;
-
-       }
-       m_DoAssociate.SetCheck(has_asso);
-       if (need_asso && has_asso)
-               OnAssociate();
-}
-
-
-void OptFiles::OnAssociate() 
-{
-       char *sKey, sDesc[200];
-       unsigned char szApp[MAX_PATH];
-       unsigned char szIco[MAX_PATH];
-
-       strcpy((char *) szApp, GetApp()->szApplicationPath);
-       strcpy((char *) szIco, (const char *) szApp);
-       strcat((char *) szIco, "Osmo4.ico");
-       strcat((char *) szApp, "Osmo4.exe \"%L\"");
-
-       if (m_DoAssociate.GetCheck()) {
-               Bool go = 1;
-               sKey = cur_ext;
-
-               HKEY hKey;
-               DWORD dwSize;
-               while (go) {
-                       Bool ok;
-                       char szExt[50], szReg[60], szOld[80], szPath[1024], c;
-                       char *tmp = strchr(sKey, ' ');
-                       if (!tmp) { go = 0;}
-                       else { c = tmp[0]; tmp[0] = 0; }
-                       sprintf(szExt, ".%s", sKey);
-                       sprintf(szReg, "GPAC\\%s", sKey);
-                       if (tmp) { tmp[0] = c; tmp += 1; }
-
-                       RegOpenKeyEx(HKEY_CLASSES_ROOT, szExt, 0, 0, &hKey );
-                       dwSize = 200;
-                       ok = 1;
-                       if (RegQueryValueEx(hKey, "", NULL, NULL,(unsigned char*) sDesc, &dwSize) != ERROR_SUCCESS) ok = 0;
-                       RegCloseKey(hKey);
-                       strcpy(szOld, "");
-                       if (ok && stricmp((char *)sDesc, szReg)) strcpy(szOld, sDesc);
-
-                       strcpy(szPath, szReg); strcat(szPath, "\\DefaultIcon");
-                       RegCreateKeyEx(HKEY_CLASSES_ROOT, szPath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
-                       RegSetValueEx(hKey, "", 0, REG_SZ, szIco, strlen((const char *) szIco)+1);
-                       RegCloseKey(hKey);
-
-                       strcpy(szPath, szReg); strcat(szPath, "\\Shell\\open\\command");
-                       RegCreateKeyEx(HKEY_CLASSES_ROOT, szPath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
-                       RegSetValueEx(hKey, "", 0, REG_SZ, szApp, strlen((const char *) szApp)+1);
-                       RegCloseKey(hKey);
-
-                       if (strlen(szOld)) {
-                               strcpy(szPath, szReg); strcat(szPath, "\\Backup");
-                               RegCreateKeyEx(HKEY_CLASSES_ROOT, szPath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
-                               RegSetValueEx(hKey, "", 0, REG_SZ, (unsigned char *) szOld, strlen((const char *) szIco)+1);
-                               RegCloseKey(hKey);
-                       }
-
-                       RegCreateKeyEx(HKEY_CLASSES_ROOT, szExt, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
-                       RegSetValueEx(hKey, "", 0, REG_SZ, (const unsigned char *) szReg, strlen(szReg)+1);
-                       RegCloseKey(hKey);
-
-                       sKey = tmp;
-               }
-       } else {
-               Bool go = 1;
-               sKey = cur_ext;
-
-               HKEY hKey;
-               DWORD dwSize;
-               while (go) {
-                       Bool ok;
-                       char szExt[50], szReg[60], szPath[1024], c;
-                       char *tmp = strchr(sKey, ' ');
-                       if (!tmp) { go = 0;}
-                       else { c = tmp[0]; tmp[0] = 0; }
-                       sprintf(szExt, ".%s", sKey);
-                       sprintf(szReg, "GPAC\\%s", sKey);
-                       if (tmp) { tmp[0] = c; tmp += 1; }
-
-                       strcpy(szPath, szReg); strcat(szPath, "\\Backup");
-                       RegOpenKeyEx(HKEY_CLASSES_ROOT, szPath, 0, 0, &hKey );
-                       dwSize = 200;
-                       ok = 1;
-                       if (RegQueryValueEx(hKey, "", NULL, NULL,(unsigned char*) sDesc, &dwSize) != ERROR_SUCCESS) ok = 0;
-                       RegCloseKey(hKey);
-                       if (ok && strlen((char *)sDesc)) {
-                               RegCreateKeyEx(HKEY_CLASSES_ROOT, szExt, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
-                               RegSetValueEx(hKey, "", 0, REG_SZ, (unsigned char*) sDesc, strlen((const char *) sDesc)+1);
-                               RegCloseKey(hKey);
-                       }
-
-                       RegOpenKeyEx(HKEY_CLASSES_ROOT, szReg, 0, 0, &hKey );
-                       RegDeleteKey(hKey, "Backup");
-                       RegDeleteKey(hKey, "DefaultIcon");
-                       RegDeleteKey(hKey, "Shell\\open\\command");
-                       RegDeleteKey(hKey, "Shell\\open");
-                       RegDeleteKey(hKey, "Shell");
-                       RegCloseKey(hKey);
-                       RegDeleteKey(HKEY_CLASSES_ROOT, szReg);
-
-                       sKey = tmp;
-               }
-       }       
-}
-
-COptLogs::COptLogs(CWnd* pParent /*=NULL*/)
-       : CDialog(COptLogs::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptLogs)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void COptLogs::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptLogs)
-       DDX_Control(pDX, IDC_TOOL_SYNC, m_sync);
-       DDX_Control(pDX, IDC_TOOL_SCRIPT, m_script);
-       DDX_Control(pDX, IDC_TOOL_SCENE, m_scene);
-       DDX_Control(pDX, IDC_TOOL_RTP, m_rtp);
-       DDX_Control(pDX, IDC_TOOL_RENDER, m_render);
-       DDX_Control(pDX, IDC_TOOL_PARSER, m_parser);
-       DDX_Control(pDX, IDC_TOOL_NET, m_net);
-       DDX_Control(pDX, IDC_TOOL_MMIO, m_mmio);
-       DDX_Control(pDX, IDC_TOOL_MEDIA, m_media);
-       DDX_Control(pDX, IDC_TOOL_CORE, m_core);
-       DDX_Control(pDX, IDC_TOOL_CONTAINER, m_container);
-       DDX_Control(pDX, IDC_TOOL_COMPOSE, m_compose);
-       DDX_Control(pDX, IDC_TOOL_CODING, m_coding);
-       DDX_Control(pDX, IDC_TOOL_CODEC, m_codec);
-       DDX_Control(pDX, IDC_TOOL_AUTHOR, m_author);
-       DDX_Control(pDX, IDC_LOG_LEVEL, m_Level);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptLogs, CDialog)
-       //{{AFX_MSG_MAP(COptLogs)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptLogs message handlers
-
-BOOL COptLogs::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-
-       Osmo4 *gpac = GetApp();
-       switch (gpac->m_log_level) {
-       case GF_LOG_ERROR: m_Level.SetCurSel(1); break;
-       case GF_LOG_WARNING: m_Level.SetCurSel(2); break;
-       case GF_LOG_INFO: m_Level.SetCurSel(3); break;
-       case GF_LOG_DEBUG: m_Level.SetCurSel(4); break;
-       default: m_Level.SetCurSel(0); break;
-       }
-
-       m_sync.SetCheck(gpac->m_log_tools & GF_LOG_SYNC);
-       m_script.SetCheck(gpac->m_log_tools & GF_LOG_SCRIPT);
-       m_scene.SetCheck(gpac->m_log_tools & GF_LOG_SCENE);
-       m_rtp.SetCheck(gpac->m_log_tools & GF_LOG_RTP);
-       m_render.SetCheck(gpac->m_log_tools & GF_LOG_COMPOSE);
-       m_parser.SetCheck(gpac->m_log_tools & GF_LOG_PARSER);
-       m_net.SetCheck(gpac->m_log_tools & GF_LOG_NETWORK);
-       m_mmio.SetCheck(gpac->m_log_tools & GF_LOG_MMIO);
-       m_media.SetCheck(gpac->m_log_tools & GF_LOG_MEDIA);
-       m_core.SetCheck(gpac->m_log_tools & GF_LOG_CORE);
-       m_container.SetCheck(gpac->m_log_tools & GF_LOG_CONTAINER);
-       m_compose.SetCheck(gpac->m_log_tools & GF_LOG_INTERACT);
-       m_coding.SetCheck(gpac->m_log_tools & GF_LOG_CODING);
-       m_codec.SetCheck(gpac->m_log_tools & GF_LOG_CODEC);
-       m_author.SetCheck(gpac->m_log_tools & GF_LOG_AUTHOR);
-
-       return TRUE;
-}
-
-void COptLogs::SaveOptions()
-{
-       Osmo4 *gpac = GetApp();
-       CString str = "";
-       u32 flags = 0;
-
-       switch (m_Level.GetCurSel()) {
-       case 1: 
-               gf_cfg_set_key(gpac->m_user.config, "General", "LogLevel", "error");
-               gpac->m_log_level = GF_LOG_ERROR;
-               break;
-       case 2: 
-               gf_cfg_set_key(gpac->m_user.config, "General", "LogLevel", "warning");
-               gpac->m_log_level = GF_LOG_WARNING;
-               break;
-       case 3: 
-               gf_cfg_set_key(gpac->m_user.config, "General", "LogLevel", "info");
-               gpac->m_log_level = GF_LOG_INFO;
-               break;
-       case 4: 
-               gf_cfg_set_key(gpac->m_user.config, "General", "LogLevel", "debug");
-               gpac->m_log_level = GF_LOG_DEBUG;
-               break;
-       default: 
-               gf_cfg_set_key(gpac->m_user.config, "General", "LogLevel", "none");
-               gpac->m_log_level = 0;
-               break;
-       }
-       gf_log_set_level(gpac->m_log_level);
-
-
-       if (m_sync.GetCheck()) { flags |= GF_LOG_SYNC; str +="sync:"; }
-       if (m_script.GetCheck()) { flags |= GF_LOG_SCRIPT; str +="script:"; }
-       if (m_scene.GetCheck()) { flags |= GF_LOG_SCENE; str +="scene:"; }
-       if (m_rtp.GetCheck()) { flags |= GF_LOG_RTP; str +="rtp:"; }
-       if (m_render.GetCheck()) { flags |= GF_LOG_COMPOSE; str +="compose:"; }
-       if (m_parser.GetCheck()) { flags |= GF_LOG_PARSER; str +="parser:"; }
-       if (m_net.GetCheck()) { flags |= GF_LOG_NETWORK; str +="network:"; }
-       if (m_mmio.GetCheck()) { flags |= GF_LOG_MMIO; str +="mmio:"; }
-       if (m_media.GetCheck()) { flags |= GF_LOG_MEDIA; str +="media:"; }
-       if (m_core.GetCheck()) { flags |= GF_LOG_CORE; str +="core:"; }
-       if (m_container.GetCheck()) { flags |= GF_LOG_CONTAINER; str +="container:"; }
-       if (m_compose.GetCheck()) { flags |= GF_LOG_INTERACT; str +="interact:"; }
-       if (m_coding.GetCheck()) { flags |= GF_LOG_CODING; str +="coding:"; }
-       if (m_codec.GetCheck()) { flags |= GF_LOG_CODEC; str +="codec:"; }
-       if (m_author.GetCheck()) { flags |= GF_LOG_AUTHOR; str +="author:"; }
-
-       gf_cfg_set_key(gpac->m_user.config, "General", "LogTools", str);
-       gpac->m_log_tools = flags;
-       gf_log_set_tools(gpac->m_log_tools);
-}
-
-void COptHTTP::OnBnClickedRestartCache()
-{
-       // TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
-}
diff --git a/applications/osmo4_w32/Options.h b/applications/osmo4_w32/Options.h
deleted file mode 100644 (file)
index 2e26e73..0000000
+++ /dev/null
@@ -1,624 +0,0 @@
-#if !defined(AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_)
-#define AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// Options.h : header file
-//
-
-
-class COptAudio : public CDialog
-{
-// Construction
-public:
-       COptAudio(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptAudio)
-       enum { IDD = IDD_OPT_AUDIO };
-       CButton m_Notifs;
-       CComboBox       m_DriverList;
-       CButton m_AudioResync;
-       CButton m_AudioMultiCH;
-       CEdit   m_AudioDur;
-       CSpinButtonCtrl m_SpinFPS;
-       CButton m_ForceConfig;
-       CSpinButtonCtrl m_AudioSpin;
-       CEdit   m_AudioEdit;
-       //}}AFX_DATA
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptAudio)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptAudio)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnForceAudio();
-       afx_msg void OnSelchangeDriverList();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// OptDecoder dialog
-
-class OptDecoder : public CDialog
-{
-// Construction
-public:
-       OptDecoder(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(OptDecoder)
-       enum { IDD = IDD_OPT_DECODER };
-       CComboBox       m_Video;
-       CComboBox       m_Audio;
-       //}}AFX_DATA
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(OptDecoder)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(OptDecoder)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-class OptFiles : public CDialog
-{
-// Construction
-public:
-       OptFiles(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(OptFiles)
-       enum { IDD = IDD_OPT_FILETYPES };
-       CButton m_DoAssociate;
-       CStatic m_PlugName;
-       CStatic m_mimes;
-       CStatic m_extensions;
-       CComboBox       m_FileDescs;
-       //}}AFX_DATA
-
-       void SetSelection(u32 sel);
-       char cur_ext[200], cur_mime[200];
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(OptFiles)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(OptFiles)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnSelchangeFilelist();
-       afx_msg void OnAssociate();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// COptFont dialog
-
-class COptFont : public CDialog
-{
-// Construction
-public:
-       COptFont(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptFont)
-       enum { IDD = IDD_OPT_FONT };
-       CComboBox       m_TextureModes;
-       CComboBox       m_Fonts;
-       CButton m_BrowseFont;
-       //}}AFX_DATA
-
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptFont)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptFont)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnBrowseFont();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// COptGen dialog
-
-class COptGen : public CDialog
-{
-// Construction
-public:
-       COptGen(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptGen)
-       enum { IDD = IDD_OPT_GEN };
-       CButton m_LookForSubs;
-       CButton m_ViewXMT;
-       CButton m_NoConsole;
-       CButton m_Loop;
-       CButton m_SingleInstance;
-       //}}AFX_DATA
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptGen)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptGen)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-// COptHTTP dialog
-
-class COptHTTP : public CDialog
-{
-// Construction
-public:
-       COptHTTP(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptHTTP)
-       enum { IDD = IDD_OPT_HTTP };
-       CEdit   m_ProxyName;
-       CButton m_useProxy;
-       CEdit   m_SAXDuration;
-       CButton m_Progressive;
-       CButton m_DisableCache;
-       CButton m_CleanCache;
-       CButton m_CacheDir;
-       //}}AFX_DATA
-
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptHTTP)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptHTTP)
-       afx_msg void OnBrowseCache();
-       virtual BOOL OnInitDialog();
-       afx_msg void OnSaxProgressive();
-       afx_msg void OnUseProxy();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-public:
-       afx_msg void OnBnClickedRestartCache();
-};
-
-
-class COptMCache : public CDialog
-{
-// Construction
-public:
-       COptMCache(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptMCache)
-       enum { IDD = IDD_OPT_MCACHE };
-       CEdit   m_BaseName;
-       CButton m_UseBase;
-       CButton m_Overwrite;
-       CButton m_RecDir;
-       //}}AFX_DATA
-
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptMCache)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptMCache)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnBrowseMcache();
-       afx_msg void OnMcacheUsename();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-class COptRender : public CDialog
-{
-// Construction
-public:
-       COptRender(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptRender)
-       enum { IDD = IDD_OPT_RENDER };
-       CComboBox       m_DrawBounds;
-       CComboBox       m_Graphics;
-       CButton m_Use3DRender;
-       CComboBox       m_AntiAlias;
-       CButton m_ForceSize;
-       CButton m_HighSpeed;
-       CComboBox       m_BIFSRate;
-       //}}AFX_DATA
-
-
-       Bool SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptRender)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptRender)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-class COptRender2D : public CDialog
-{
-// Construction
-public:
-       COptRender2D(CWnd* pParent = NULL);   // standard constructor
-
-       void SaveOptions();
-       void SetYUV();
-
-// Dialog Data
-       //{{AFX_DATA(COptRender2D)
-       enum { IDD = IDD_OPT_RENDER2D };
-       CStatic m_YUVFormat;
-       CButton m_NoYUV;
-       CButton m_Scalable;
-       CButton m_DirectRender;
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptRender2D)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptRender2D)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-class COptRender3D : public CDialog
-{
-// Construction
-public:
-       COptRender3D(CWnd* pParent = NULL);   // standard constructor
-
-       void SaveOptions();
-
-// Dialog Data
-       //{{AFX_DATA(COptRender3D)
-       enum { IDD = IDD_OPT_RENDER3D };
-       CButton m_BitmapPixels;
-       CButton m_DisableTXRect;
-       CButton m_RasterOutlines;
-       CButton m_EmulPow2;
-       CButton m_PolyAA;
-       CComboBox       m_BackCull;
-       CComboBox       m_DrawNormals;
-       CComboBox       m_Wireframe;
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptRender3D)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptRender3D)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-class COptStream : public CDialog
-{
-// Construction
-public:
-       COptStream(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptStream)
-       enum { IDD = IDD_OPT_STREAM };
-       CEdit   m_RebufferLen;
-       CButton m_Rebuffer;
-       CEdit   m_Buffer;
-       CEdit   m_Timeout;
-       CButton m_Reorder;
-       CButton m_UseRTSP;
-       CComboBox       m_Port;
-       //}}AFX_DATA
-
-
-       void SaveOptions();
-
-       void CheckRebuffer();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptStream)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptStream)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnSelchangePort();
-       afx_msg void OnRtsp();
-       afx_msg void OnRebuffer();
-       afx_msg void OnUpdateRebufferLen();
-       afx_msg void OnUpdateBuffer();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-class COptSystems : public CDialog
-{
-// Construction
-public:
-       COptSystems(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptSystems)
-       enum { IDD = IDD_OPT_SYSTEMS };
-       CButton m_ForceDuration;
-       CComboBox       m_Threading;
-       CButton m_BifsAlwaysDrawn;
-       CComboBox       m_Lang;
-       //}}AFX_DATA
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptSystems)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptSystems)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-class COptVideo : public CDialog
-{
-// Construction
-public:
-       COptVideo(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptVideo)
-       enum { IDD = IDD_OPT_VIDEO };
-       CButton m_SwitchRes;
-       CButton m_UseHWMemory;
-       CComboBox       m_Videos;
-       //}}AFX_DATA
-
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptVideo)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptVideo)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// COptLogs dialog
-
-class COptLogs : public CDialog
-{
-// Construction
-public:
-       COptLogs(CWnd* pParent = NULL);   // standard constructor
-       void SaveOptions();
-
-// Dialog Data
-       //{{AFX_DATA(COptLogs)
-       enum { IDD = IDD_OPT_LOGS };
-       CButton m_sync;
-       CButton m_script;
-       CButton m_scene;
-       CButton m_rtp;
-       CButton m_render;
-       CButton m_parser;
-       CButton m_net;
-       CButton m_mmio;
-       CButton m_media;
-       CButton m_core;
-       CButton m_container;
-       CButton m_compose;
-       CButton m_coding;
-       CButton m_codec;
-       CButton m_author;
-       CComboBox       m_Level;
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptLogs)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptLogs)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions dialog
-
-class COptions : public CDialog
-{
-// Construction
-public:
-       COptions(CWnd* pParent = NULL);   // standard constructor
-       BOOL Create(CWnd * pParent)
-       {
-               return CDialog::Create( COptions::IDD, pParent);
-       }
-
-// Dialog Data
-       //{{AFX_DATA(COptions)
-       enum { IDD = IDD_OPTIONS };
-       CComboBox       m_Selector;
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptions)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       COptGen m_general;
-       COptSystems m_systems;
-       COptRender m_render;
-       COptRender2D m_render2d;
-       COptRender3D m_render3d;
-       COptAudio m_audio;
-       OptDecoder m_decoder;
-       COptVideo m_video;
-       COptHTTP m_http;
-       COptFont m_font;
-       COptStream m_stream;
-       COptMCache m_cache;
-       OptFiles m_files;
-       COptLogs m_logs;
-
-       void HideAll();
-
-       // Generated message map functions
-       //{{AFX_MSG(COptions)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnSaveopt();
-       afx_msg void OnClose();
-       afx_msg void OnDestroy();
-       afx_msg void OnSelchangeSelect();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_)
diff --git a/applications/osmo4_w32/Osmo4.cpp b/applications/osmo4_w32/Osmo4.cpp
deleted file mode 100644 (file)
index 41f434e..0000000
+++ /dev/null
@@ -1,916 +0,0 @@
-// GPAC.cpp : Defines the class behaviors for the application.
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-#include <gpac/network.h>
-#include <direct.h>
-#include "MainFrm.h"
-#include "OpenUrl.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// Osmo4
-
-BEGIN_MESSAGE_MAP(Osmo4, CWinApp)
-       //{{AFX_MSG_MAP(Osmo4)
-       ON_COMMAND(ID_FILEOPEN, OnOpenFile)
-       ON_COMMAND(ID_FILE_STEP, OnFileStep)
-       ON_COMMAND(ID_OPEN_URL, OnOpenUrl)
-       ON_COMMAND(ID_FILE_RELOAD, OnFileReload)
-       ON_COMMAND(ID_CONFIG_RELOAD, OnConfigReload)
-       ON_COMMAND(ID_FILE_PLAY, OnFilePlay)
-       ON_UPDATE_COMMAND_UI(ID_FILE_PLAY, OnUpdateFilePlay)
-       ON_UPDATE_COMMAND_UI(ID_FILE_STEP, OnUpdateFileStep)
-       ON_COMMAND(ID_FILE_STOP, OnFileStop)
-       ON_UPDATE_COMMAND_UI(ID_FILE_STOP, OnUpdateFileStop)
-       ON_COMMAND(ID_SWITCH_RENDER, OnSwitchRender)
-       ON_UPDATE_COMMAND_UI(ID_FILE_RELOAD, OnUpdateFileStop)
-       ON_COMMAND(ID_H_ABOUT, OnAbout)
-       ON_COMMAND(ID_FILE_MIGRATE, OnFileMigrate)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// Osmo4 construction
-
-Osmo4::Osmo4()
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// The one and only Osmo4 object
-
-Osmo4 theApp;
-
-
-
-class UserPassDialog : public CDialog
-{
-// Construction
-public:
-       UserPassDialog(CWnd* pParent = NULL);   // standard constructor
-
-       Bool GetPassword(const char *site_url, char *user, char *password);
-
-// Dialog Data
-       //{{AFX_DATA(UserPassDialog)
-       enum { IDD = IDD_PASSWD };
-       CStatic m_SiteURL;
-       CEdit m_User;
-       CEdit m_Pass;
-       //}}AFX_DATA
-
-       void SetSelection(u32 sel);
-       char cur_ext[200], cur_mime[200];
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(UserPassDialog)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-       const char *m_site_url;
-       char *m_user, *m_password;
-
-       // Generated message map functions
-       //{{AFX_MSG(UserPassDialog)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnClose();
-       //}}AFX_MSG
-};
-
-UserPassDialog::UserPassDialog(CWnd* pParent /*=NULL*/)
-       : CDialog(UserPassDialog::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptStream)
-       //}}AFX_DATA_INIT
-}
-
-void UserPassDialog::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(UserPassDialog)
-       DDX_Control(pDX, IDC_TXT_SITE, m_SiteURL);
-       DDX_Control(pDX, IDC_EDIT_USER, m_User);
-       DDX_Control(pDX, IDC_EDIT_PASSWORD, m_Pass);
-       //}}AFX_DATA_MAP
-}
-
-BOOL UserPassDialog::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       m_SiteURL.SetWindowText(m_site_url);
-       m_User.SetWindowText(m_user);
-       m_Pass.SetWindowText("");
-       return TRUE;
-}
-
-void UserPassDialog::OnClose()
-{
-       m_User.GetWindowText(m_user, 50);
-       m_Pass.GetWindowText(m_password, 50);
-}
-
-Bool UserPassDialog::GetPassword(const char *site_url, char *user, char *password)
-{
-       m_site_url = site_url;
-       m_user = user;
-       if (DoModal() != IDOK) return 0;
-       return 1;
-}
-
-
-static void Osmo4_progress_cbk(const void *usr, const char *title, u64 done, u64 total)
-{
-       if (!total) return;
-       CMainFrame *pFrame = (CMainFrame *) ((Osmo4 *) usr)->m_pMainWnd;
-       s32 prog = (s32) ( (100 * (u64)done) / total);
-       if (pFrame->m_last_prog < prog) {
-               pFrame->console_err = GF_OK;
-               pFrame->m_last_prog = prog;
-               pFrame->console_message.Format("%s %02d %%", title, prog);
-               pFrame->PostMessage(WM_CONSOLEMSG, 0, 0);
-               if (done==total) pFrame->m_last_prog = -1;
-       }
-}
-
-#define W32_MIN_WIDTH 120
-
-static void log_msg(char *msg)
-{
-       ::MessageBox(NULL, msg, "GPAC", MB_OK);
-}
-Bool Osmo4_EventProc(void *priv, GF_Event *evt)
-{
-       u32 dur;
-       Osmo4 *gpac = (Osmo4 *) priv;
-       CMainFrame *pFrame = (CMainFrame *) gpac->m_pMainWnd;
-       /*shutdown*/
-       if (!pFrame) return 0;
-
-       switch (evt->type) {
-       case GF_EVENT_DURATION:
-               dur = (u32) (1000 * evt->duration.duration);
-               //if (dur<1100) dur = 0;
-               pFrame->m_pPlayList->SetDuration((u32) evt->duration.duration );
-               gpac->max_duration = dur;
-               gpac->can_seek = evt->duration.can_seek;
-               if (!gpac->can_seek) {
-                       pFrame->m_Sliders.m_PosSlider.EnableWindow(FALSE);
-               } else {
-                       pFrame->m_Sliders.m_PosSlider.EnableWindow(TRUE);
-                       pFrame->m_Sliders.m_PosSlider.SetRangeMin(0);
-                       pFrame->m_Sliders.m_PosSlider.SetRangeMax(dur);
-               }
-               break;
-
-       case GF_EVENT_MESSAGE:
-               if (!evt->message.service || !strcmp(evt->message.service, (LPCSTR) pFrame->m_pPlayList->GetURL() )) {
-                       pFrame->console_service = "main service";
-               } else {
-                       pFrame->console_service = evt->message.service;
-               }
-               if (evt->message.error!=GF_OK) {
-                       if (evt->message.error<GF_OK || !gpac->m_NoConsole) {
-                               pFrame->console_err = evt->message.error;
-                               pFrame->console_message = evt->message.message;
-                               gpac->m_pMainWnd->PostMessage(WM_CONSOLEMSG, 0, 0);
-
-                               /*any error before connection confirm is a service connection error*/
-                               if (!gpac->m_isopen) pFrame->m_pPlayList->SetDead();
-                       }
-                       return 0;
-               }
-               if (gpac->m_NoConsole) return 0;
-
-               /*process user message*/
-               pFrame->console_err = GF_OK;
-               pFrame->console_message = evt->message.message;
-               gpac->m_pMainWnd->PostMessage(WM_CONSOLEMSG, 0, 0);
-               break;
-       case GF_EVENT_PROGRESS:
-               char *szType;
-               if (evt->progress.progress_type==0) szType = "Buffer ";
-               else if (evt->progress.progress_type==1) szType = "Download ";
-               else if (evt->progress.progress_type==2) szType = "Import ";
-               gf_set_progress(szType, evt->progress.done, evt->progress.total);
-               break;
-       case GF_EVENT_NAVIGATE_INFO:
-               pFrame->console_message = evt->navigate.to_url;
-               gpac->m_pMainWnd->PostMessage(WM_CONSOLEMSG, 1000, 0);
-               break;
-
-       case GF_EVENT_SCENE_SIZE:
-               if (evt->size.width && evt->size.height) {
-                       gpac->orig_width = evt->size.width;
-                       gpac->orig_height = evt->size.height;
-                       if (gpac->m_term && !pFrame->m_bFullScreen) 
-                               pFrame->PostMessage(WM_SETSIZE, evt->size.width, evt->size.height);
-               }
-               break;
-       /*don't resize on win32 msg notif*/
-#if 0
-       case GF_EVENT_SIZE:
-               if (/*gpac->m_term && !pFrame->m_bFullScreen && */gpac->orig_width && (evt->size.width < W32_MIN_WIDTH) ) 
-                       pFrame->PostMessage(WM_SETSIZE, W32_MIN_WIDTH, (W32_MIN_WIDTH*gpac->orig_height) / gpac->orig_width);
-               else
-                       pFrame->PostMessage(WM_SETSIZE, evt->size.width, evt->size.height);
-               break;
-#endif
-
-       case GF_EVENT_CONNECT:
-//             if (pFrame->m_bStartupFile) return 0;
-
-               pFrame->BuildStreamList(1);
-               if (evt->connect.is_connected) {
-                       pFrame->BuildChapterList(0);
-                       gpac->m_isopen = 1;
-               } else {
-                       gpac->max_duration = 0;
-                       gpac->m_isopen = 0;
-                       pFrame->BuildChapterList(1);
-               }
-               pFrame->m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, gpac->m_isopen ? 4 : 3);
-               pFrame->m_Sliders.m_PosSlider.SetPos(0);
-               pFrame->SetProgTimer(1);
-               if (!pFrame->m_bFullScreen) {
-                       pFrame->SetFocus();
-                       pFrame->SetForegroundWindow();
-               }
-               break;
-
-       case GF_EVENT_QUIT:
-               pFrame->PostMessage(WM_CLOSE, 0L, 0L);
-               break;
-       case GF_EVENT_MIGRATE:
-       {
-       }
-               break;
-       case GF_EVENT_KEYDOWN:
-               gf_term_process_shortcut(gpac->m_term, evt);
-               /*update volume control*/
-               pFrame->m_Sliders.SetVolume();
-
-               switch (evt->key.key_code) {
-               case GF_KEY_HOME:
-                       gf_term_set_option(gpac->m_term, GF_OPT_NAVIGATION_TYPE, 1);
-                       break;
-               case GF_KEY_ESCAPE:
-                       pFrame->PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN);
-                       break;
-               case GF_KEY_MEDIANEXTTRACK:
-                       pFrame->m_pPlayList->PlayNext();
-                       break;
-               case GF_KEY_MEDIAPREVIOUSTRACK:
-                       pFrame->m_pPlayList->PlayPrev();
-                       break;
-               case GF_KEY_H:
-                       if ((evt->key.flags & GF_KEY_MOD_CTRL) && gpac->m_isopen)
-                               gf_term_switch_quality(gpac->m_term, 1);
-                       break;
-               case GF_KEY_L:
-                       if ((evt->key.flags & GF_KEY_MOD_CTRL) && gpac->m_isopen)
-                               gf_term_switch_quality(gpac->m_term, 0);
-                       break;
-               }
-               break;
-       case GF_EVENT_NAVIGATE:
-               /*fixme - a proper browser would require checking mime type & co*/
-               /*store URL since it may be destroyed, and post message*/
-               gpac->m_navigate_url = evt->navigate.to_url;
-               pFrame->PostMessage(WM_NAVIGATE, NULL, NULL);
-               return 1;
-       case GF_EVENT_VIEWPOINTS:
-               pFrame->BuildViewList();
-               return 0;
-       case GF_EVENT_STREAMLIST:
-               pFrame->BuildStreamList(0);
-               return 0;
-       case GF_EVENT_SET_CAPTION:
-               pFrame->SetWindowText(evt->caption.caption);
-               break;
-       case GF_EVENT_DBLCLICK:
-               pFrame->PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN);
-               return 0;
-       case GF_EVENT_AUTHORIZATION:
-       {
-               UserPassDialog passdlg;
-               return passdlg.GetPassword(evt->auth.site_url, evt->auth.user, evt->auth.password);
-       }
-       }
-       return 0;
-}
-
-
-/*here's the trick: use a storage section shared among all processes for the wnd handle and for the command line
-NOTE: this has to be static memory of course, don't try to alloc anything there...*/
-#pragma comment(linker, "/SECTION:.shr,RWS") 
-#pragma data_seg(".shr") 
-HWND static_gpac_hwnd = NULL; 
-char static_szCmdLine[MAX_PATH] = "";
-#pragma data_seg() 
-
-const char *static_gpac_get_url()
-{
-       return (const char *) static_szCmdLine;
-}
-
-static void osmo4_do_log(void *cbk, u32 level, u32 tool, const char *fmt, va_list list)
-{
-       FILE *logs = (FILE *) cbk;
-    vfprintf(logs, fmt, list);
-       fflush(logs);
-}
-
-BOOL Osmo4::InitInstance()
-{
-       CCommandLineInfo cmdInfo;
-
-       m_logs = NULL;
-
-       m_term = NULL;
-
-       memset(&m_user, 0, sizeof(GF_User));
-
-       /*get Osmo4.exe path*/
-       strcpy((char *) szApplicationPath, AfxGetApp()->m_pszHelpFilePath);
-       while (szApplicationPath[strlen((char *) szApplicationPath)-1] != '\\') szApplicationPath[strlen((char *) szApplicationPath)-1] = 0;
-       if (szApplicationPath[strlen((char *) szApplicationPath)-1] != '\\') strcat(szApplicationPath, "\\");
-
-       gf_sys_init(0);
-
-       /*setup user*/
-       memset(&m_user, 0, sizeof(GF_User));
-
-       Bool first_launch = 0;
-       /*init config and modules*/
-       m_user.config = gf_cfg_init(NULL, &first_launch);
-       if (!m_user.config) {
-               MessageBox(NULL, "GPAC Configuration file not found", "Fatal Error", MB_OK);
-               m_pMainWnd->PostMessage(WM_CLOSE);
-       }
-
-       char *name = gf_cfg_get_filename(m_user.config);
-       char *sep = strrchr(name, '\\');
-       if (sep) sep[0] = 0;
-       strcpy(szUserPath, name);
-       if (sep) sep[0] = '\\';
-       gf_free(name);
-
-       const char *opt = gf_cfg_get_key(m_user.config, "General", "SingleInstance");
-       m_SingleInstance = (opt && !stricmp(opt, "yes")) ? 1 : 0;
-
-       m_hMutex = NULL;
-       if (m_SingleInstance) {
-               m_hMutex = CreateMutex(NULL, FALSE, "Osmo4_GPAC_INSTANCE");
-               if ( GetLastError() == ERROR_ALREADY_EXISTS ) {
-                       char szDIR[1024];
-                       if (m_hMutex) CloseHandle(m_hMutex);
-                       m_hMutex = NULL;
-
-                       if (!static_gpac_hwnd || !IsWindow(static_gpac_hwnd) ) {
-                               ::MessageBox(NULL, "Osmo4 ghost process detected", "Error at last shutdown" , MB_OK);
-                       } else {
-                               ::SetForegroundWindow(static_gpac_hwnd);
-
-                               if (m_lpCmdLine && strlen(m_lpCmdLine)) {
-                                       DWORD res;
-                                       u32 len;
-                                       char *the_url, *cmd;
-                                       GetCurrentDirectory(1024, szDIR);
-                                       if (szDIR[strlen(szDIR)-1] != '\\') strcat(szDIR, "\\");
-                                       cmd = (char *)(const char *) m_lpCmdLine;
-                                       strcpy(static_szCmdLine, "");
-                                       if (cmd[0]=='"') cmd+=1;
-
-                                       if (!strnicmp(cmd, "-queue ", 7)) {
-                                               strcat(static_szCmdLine, "-queue ");
-                                               cmd += 7;
-                                       }
-                                       the_url = gf_url_concatenate(szDIR, cmd);
-                                       if (!the_url) {
-                                               strcat(static_szCmdLine, cmd);
-                                       } else {
-                                               strcat(static_szCmdLine, the_url);
-                                               gf_free(the_url);
-                                       }
-                                       while ( (len = strlen(static_szCmdLine)) ) {
-                                               char s = static_szCmdLine[len-1];
-                                               if ((s==' ') || (s=='"')) static_szCmdLine[len-1]=0;
-                                               else break;
-                                       }
-                                       ::SendMessageTimeout(static_gpac_hwnd, WM_NEWINSTANCE, 0, 0, 0, 1000, &res);
-                               }
-                       }
-                       
-                       return FALSE;
-               }
-       }
-
-#if 0
-       // Standard initialization
-#ifdef _AFXDLL
-       Enable3dControls();                     // Call this when using MFC in a shared DLL
-#else
-       Enable3dControlsStatic();       // Call this when linking to MFC statically
-#endif
-
-#endif
-
-       SetRegistryKey(_T("GPAC"));
-       CMainFrame* pFrame = new CMainFrame;
-       m_pMainWnd = pFrame;
-       pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL);
-       m_pMainWnd->DragAcceptFiles();
-
-       if (m_SingleInstance) static_gpac_hwnd = m_pMainWnd->m_hWnd;
-
-       const char *str = gf_cfg_get_key(m_user.config, "General", "ModulesDirectory");
-       m_user.modules = gf_modules_new(str, m_user.config);
-       if (!m_user.modules || ! gf_modules_get_count(m_user.modules) ) {
-               MessageBox(NULL, "No modules available - system cannot work", "Fatal Error", MB_OK);
-               m_pMainWnd->PostMessage(WM_CLOSE);
-       }
-       else if (first_launch) {
-               /*first launch, register all files ext*/
-               u32 i;
-               for (i=0; i<gf_modules_get_count(m_user.modules); i++) {
-                       GF_InputService *ifce = (GF_InputService *) gf_modules_load_interface(m_user.modules, i, GF_NET_CLIENT_INTERFACE);
-                       if (!ifce) continue;
-                       if (ifce) {
-                               ifce->CanHandleURL(ifce, "test.test");
-                               gf_modules_close_interface((GF_BaseInterface *)ifce);
-                       }
-               }
-               /*set some shortcuts*/
-               gf_cfg_set_key(m_user.config, "Shortcuts", "VolumeUp", "ctrl+Up");
-               gf_cfg_set_key(m_user.config, "Shortcuts", "VolumeDown", "ctrl+Down");
-               gf_cfg_set_key(m_user.config, "Shortcuts", "FastRewind", "ctrl+Left");
-               gf_cfg_set_key(m_user.config, "Shortcuts", "FastForward", "ctrl+Right");
-               gf_cfg_set_key(m_user.config, "Shortcuts", "Play", "ctrl+ ");
-       }
-
-       /*check log file*/
-       str = gf_cfg_get_key(m_user.config, "General", "LogFile");
-       if (str) {
-               m_logs = gf_f64_open(str, "wt");
-               gf_log_set_callback(m_logs, osmo4_do_log);
-       }
-       else m_logs = NULL;
-
-       /*set log level*/
-       m_log_level = gf_log_parse_level(gf_cfg_get_key(m_user.config, "General", "LogLevel"));
-       gf_log_set_level(m_log_level);
-
-       /*set log tools*/
-       m_log_tools = gf_log_parse_tools(gf_cfg_get_key(m_user.config, "General", "LogTools"));
-       gf_log_set_tools(m_log_tools); 
-       
-       m_user.opaque = this;
-       m_user.os_window_handler = pFrame->m_pWndView->m_hWnd;
-       m_user.EventProc = Osmo4_EventProc;
-
-       m_reset = 0;
-       orig_width = 320;
-       orig_height = 240;
-
-       gf_set_progress_callback(this, Osmo4_progress_cbk);
-
-       m_term = gf_term_new(&m_user);
-       if (! m_term) {
-               MessageBox(NULL, "Cannot load GPAC Terminal", "Fatal Error", MB_OK);
-               m_pMainWnd->PostMessage(WM_CLOSE);
-               return TRUE;
-       }
-       SetOptions();
-       UpdateRenderSwitch();
-
-       pFrame->SendMessage(WM_SETSIZE, orig_width, orig_height);
-       pFrame->m_Address.ReloadURLs();
-
-       pFrame->m_Sliders.SetVolume();
-
-       m_reconnect_time = 0;
-
-
-       ParseCommandLine(cmdInfo);
-
-       start_mode = 0;
-
-       if (! cmdInfo.m_strFileName.IsEmpty()) {
-               pFrame->m_pPlayList->QueueURL(cmdInfo.m_strFileName);
-               pFrame->m_pPlayList->RefreshList();
-               pFrame->m_pPlayList->PlayNext();
-       } else {
-               char sPL[MAX_PATH];
-               strcpy((char *) sPL, szUserPath);
-               strcat(sPL, "gpac_pl.m3u");
-               pFrame->m_pPlayList->OpenPlayList(sPL);
-               const char *sOpt = gf_cfg_get_key(GetApp()->m_user.config, "General", "PLEntry");
-               if (sOpt) {
-                       s32 count = (s32)gf_list_count(pFrame->m_pPlayList->m_entries);
-                       pFrame->m_pPlayList->m_cur_entry = atoi(sOpt);
-                       if (pFrame->m_pPlayList->m_cur_entry>=count)
-                               pFrame->m_pPlayList->m_cur_entry = count-1;
-               } else {
-                       pFrame->m_pPlayList->m_cur_entry = -1;
-               }
-#if 0
-               if (pFrame->m_pPlayList->m_cur_entry>=0) {
-                       start_mode = 1;
-                       pFrame->m_pPlayList->Play();
-               }
-#endif
-
-               sOpt = gf_cfg_get_key(GetApp()->m_user.config, "General", "StartupFile");
-               if (sOpt) gf_term_connect(m_term, sOpt);
-       }
-       pFrame->SetFocus();
-       pFrame->SetForegroundWindow();
-       return TRUE;
-}
-
-int Osmo4::ExitInstance() 
-{
-       if (m_term) gf_term_del(m_term);
-       if (m_user.modules) gf_modules_del(m_user.modules);
-       if (m_user.config) gf_cfg_del(m_user.config);
-       gf_sys_close();
-       /*last instance*/
-       if (m_hMutex) {
-               CloseHandle(m_hMutex);
-               static_gpac_hwnd = NULL;
-       }
-       if (m_logs) fclose(m_logs);
-       return CWinApp::ExitInstance();
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Osmo4 message handlers
-
-
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CAboutDlg dialog used for App About
-
-class CAboutDlg : public CDialog
-{
-public:
-       CAboutDlg();
-
-// Dialog Data
-       //{{AFX_DATA(CAboutDlg)
-       enum { IDD = IDD_ABOUTBOX };
-       //}}AFX_DATA
-
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CAboutDlg)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-       //{{AFX_MSG(CAboutDlg)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnGogpac();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
-{
-       //{{AFX_DATA_INIT(CAboutDlg)
-       //}}AFX_DATA_INIT
-}
-
-void CAboutDlg::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(CAboutDlg)
-       //}}AFX_DATA_MAP
-}
-
-BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
-       //{{AFX_MSG_MAP(CAboutDlg)
-       ON_BN_CLICKED(IDC_GOGPAC, OnGogpac)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-void Osmo4::OnAbout() 
-{
-       CAboutDlg aboutDlg;
-       aboutDlg.DoModal();
-}
-
-BOOL CAboutDlg::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       CString str = "GPAC/Osmo4 - version " GPAC_FULL_VERSION;
-       SetWindowText(str);
-       return TRUE;  
-}
-
-void CAboutDlg::OnGogpac() 
-{
-       ShellExecute(NULL, "open", "http://gpac.sourceforge.net", NULL, NULL, SW_SHOWNORMAL);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// Osmo4 message handlers
-
-
-void Osmo4::SetOptions()
-{
-       const char *sOpt = gf_cfg_get_key(m_user.config, "General", "Loop");
-       m_Loop = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
-       sOpt = gf_cfg_get_key(m_user.config, "General", "LookForSubtitles");
-       m_LookForSubtitles = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
-       sOpt = gf_cfg_get_key(m_user.config, "General", "ConsoleOff");
-       m_NoConsole = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
-       sOpt = gf_cfg_get_key(m_user.config, "General", "ViewXMT");
-       m_ViewXMTA  = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
-       sOpt = gf_cfg_get_key(m_user.config, "General", "NoMIMETypeFetch");
-       m_NoMimeFetch = (!sOpt || !stricmp(sOpt, "yes")) ? 1 : 0;
-}
-
-
-void Osmo4::OnOpenUrl() 
-{
-       COpenUrl url;
-       if (url.DoModal() != IDOK) return;
-
-       CMainFrame *pFrame = (CMainFrame *) m_pMainWnd;
-       pFrame->m_pPlayList->Truncate();
-       pFrame->m_pPlayList->QueueURL(url.m_url);
-       pFrame->m_pPlayList->RefreshList();
-       pFrame->m_pPlayList->PlayNext();
-}
-
-
-CString Osmo4::GetFileFilter()
-{
-       u32 keyCount, i;
-       CString sFiles;
-       CString sExts;
-       CString supportedFiles;
-
-       /*force MP4 and 3GP files at beginning to make sure they are selected (Win32 bug with too large filters)*/
-       supportedFiles = "All Known Files|*.m3u;*.pls;*.mp4;*.3gp;*.3g2";
-
-       sExts = "";
-       sFiles = "";
-       keyCount = gf_cfg_get_key_count(m_user.config, "MimeTypes");
-       for (i=0; i<keyCount; i++) {
-               const char *sMime;
-               Bool first;
-               char *sKey;
-               const char *opt;
-               char szKeyList[1000], sDesc[1000];
-               sMime = gf_cfg_get_key_name(m_user.config, "MimeTypes", i);
-               if (!sMime) continue;
-               CString sOpt;
-               opt = gf_cfg_get_key(m_user.config, "MimeTypes", sMime);
-               /*remove module name*/
-               strcpy(szKeyList, opt+1);
-               sKey = strrchr(szKeyList, '\"');
-               if (!sKey) continue;
-               sKey[0] = 0;
-               /*get description*/
-               sKey = strrchr(szKeyList, '\"');
-               if (!sKey) continue;
-               strcpy(sDesc, sKey+1);
-               sKey[0] = 0;
-               sKey = strrchr(szKeyList, '\"');
-               if (!sKey) continue;
-               sKey[0] = 0;
-
-               /*if same description for # mime types skip (means an old mime syntax)*/
-               if (sFiles.Find(sDesc)>=0) continue;
-               /*if same extensions for # mime types skip (don't polluate the file list)*/
-               if (sExts.Find(szKeyList)>=0) continue;
-
-               sExts += szKeyList;
-               sExts += " ";
-               sFiles += sDesc;
-               sFiles += "|";
-
-               first = 1;
-
-               sOpt = CString(szKeyList);
-               while (1) {
-                       
-                       int pos = sOpt.Find(' ');
-                       CString ext = (pos==-1) ? sOpt : sOpt.Left(pos);
-                       /*WATCHOUT: we do have some "double" ext , eg .wrl.gz - these are NOT supported by windows*/
-                       if (ext.Find(".")<0) {
-                               if (!first) {
-                                       sFiles += ";";
-                               } else {
-                                       first = 0;
-                               }
-                               sFiles += "*.";
-                               sFiles += ext;
-
-                               CString sext = ext;
-                               sext += ";";
-                               if (supportedFiles.Find(sext)<0) {
-                                       supportedFiles += ";*.";
-                                       supportedFiles += ext;
-                               }
-                       }
-
-                       if (sOpt==ext) break;
-                       CString rem;
-                       rem.Format("%s ", (LPCTSTR) ext);
-                       sOpt.Replace((LPCTSTR) rem, "");
-               }
-               sFiles += "|";
-       }
-       supportedFiles += "|";
-       supportedFiles += sFiles;
-       supportedFiles += "M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|All Files |*.*|";
-       return supportedFiles;
-}
-
-void Osmo4::OnOpenFile() 
-{
-       CString sFiles = GetFileFilter();
-       u32 nb_items;
-       
-       /*looks like there's a bug here, main filter isn't used correctly while the others are*/
-       CFileDialog fd(TRUE,NULL,NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST , sFiles);
-       fd.m_ofn.nMaxFile = 25000;
-       fd.m_ofn.lpstrFile = (char *) gf_malloc(sizeof(char) * fd.m_ofn.nMaxFile);
-       fd.m_ofn.lpstrFile[0] = 0;
-
-       if (fd.DoModal()!=IDOK) {
-               gf_free(fd.m_ofn.lpstrFile);
-               return;
-       }
-
-       CMainFrame *pFrame = (CMainFrame *) m_pMainWnd;
-
-       nb_items = 0;
-       POSITION pos = fd.GetStartPosition();
-       while (pos) {
-               CString file = fd.GetNextPathName(pos);
-               nb_items++;
-       }
-       /*if several items, act as playlist (replace playlist), otherwise as browser (lost all "next" context)*/
-       if (nb_items==1) 
-               pFrame->m_pPlayList->Truncate();
-       else
-               pFrame->m_pPlayList->Clear();
-
-       pos = fd.GetStartPosition();
-       while (pos) {
-               CString file = fd.GetNextPathName(pos);
-               pFrame->m_pPlayList->QueueURL(file);
-       }
-       gf_free(fd.m_ofn.lpstrFile);
-       pFrame->m_pPlayList->RefreshList();
-       pFrame->m_pPlayList->PlayNext();
-}
-
-
-void Osmo4::Pause()
-{
-       if (!m_isopen) return;
-       gf_term_set_option(m_term, GF_OPT_PLAY_STATE, (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) ? GF_STATE_PAUSED : GF_STATE_PLAYING);
-}
-
-void Osmo4::OnMainPause() 
-{
-       Pause();        
-}
-
-void Osmo4::OnFileStep() 
-{
-       gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_STEP_PAUSE);
-       ((CMainFrame *) m_pMainWnd)->m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, 3);
-}
-void Osmo4::OnUpdateFileStep(CCmdUI* pCmdUI) 
-{
-       pCmdUI->Enable(m_isopen && !m_reset);   
-}
-
-void Osmo4::PlayFromTime(u32 time)
-{
-       Bool do_pause;
-       if (start_mode==1) do_pause = 1;
-       else if (start_mode==2) do_pause = 0;
-       else do_pause = /*!m_AutoPlay*/0;
-       gf_term_play_from_time(m_term, time, do_pause);
-       m_reset = 0;
-}
-
-
-void Osmo4::OnFileReload() 
-{
-       gf_term_disconnect(m_term);
-       m_pMainWnd->PostMessage(WM_OPENURL);
-}
-
-void Osmo4::OnFileMigrate() 
-{
-}
-
-void Osmo4::OnConfigReload() 
-{
-       gf_term_set_option(m_term, GF_OPT_RELOAD_CONFIG, 1); 
-}
-
-void Osmo4::UpdatePlayButton(Bool force_play)
-{
-       if (!force_play && gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
-               ((CMainFrame *) m_pMainWnd)->m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, 4);
-       } else {
-               ((CMainFrame *) m_pMainWnd)->m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, 3);
-       }
-}
-
-void Osmo4::OnFilePlay() 
-{
-       if (m_isopen) {
-               if (m_reset) {
-                       m_reset = 0;
-                       PlayFromTime(0);
-                       ((CMainFrame *)m_pMainWnd)->SetProgTimer(1);
-               } else {
-                       Pause();
-               }
-               UpdatePlayButton();
-       } else {
-               ((CMainFrame *) m_pMainWnd)->m_pPlayList->Play();
-       }
-}
-
-void Osmo4::OnUpdateFilePlay(CCmdUI* pCmdUI) 
-{
-       if (m_isopen) {
-               pCmdUI->Enable(TRUE);   
-               if (pCmdUI->m_nID==ID_FILE_PLAY) {
-                       if (!m_isopen) {
-                               pCmdUI->SetText("Play/Pause\tCtrl+P");
-                       } else if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
-                               pCmdUI->SetText("Pause\tCtrl+P");
-                       } else {
-                               pCmdUI->SetText("Resume\tCtrl+P");
-                       }
-               }
-       } else {
-               pCmdUI->Enable(((CMainFrame *)m_pMainWnd)->m_pPlayList->HasValidEntries() );    
-               pCmdUI->SetText("Play\tCtrl+P");
-       }
-}
-
-void Osmo4::OnFileStop() 
-{
-       CMainFrame *pFrame = (CMainFrame *) m_pMainWnd;
-       if (m_reset) return;
-       if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) Pause();
-       m_reset = 1;
-       pFrame->m_Sliders.m_PosSlider.SetPos(0);
-       pFrame->SetProgTimer(0);
-       pFrame->m_wndToolBar.SetButtonInfo(5, ID_FILE_PLAY, TBBS_BUTTON, 3);
-       start_mode = 2;
-}
-
-void Osmo4::OnUpdateFileStop(CCmdUI* pCmdUI) 
-{
-//     pCmdUI->Enable(m_isopen);       
-}
-
-void Osmo4::OnSwitchRender() 
-{
-       const char *opt = gf_cfg_get_key(m_user.config, "Compositor", "ForceOpenGL");
-       Bool use_gl = (opt && !stricmp(opt, "yes")) ? 1 : 0;
-       gf_cfg_set_key(m_user.config, "Compositor", "ForceOpenGL", use_gl ? "no" : "yes");
-
-       gf_term_set_option(m_term, GF_OPT_USE_OPENGL, !use_gl);
-
-       UpdateRenderSwitch();
-}
-
-void Osmo4::UpdateRenderSwitch()
-{
-       const char *opt = gf_cfg_get_key(m_user.config, "Compositor", "ForceOpenGL");
-       if (opt && !stricmp(opt, "no"))
-               ((CMainFrame *) m_pMainWnd)->m_wndToolBar.SetButtonInfo(12, ID_SWITCH_RENDER, TBBS_BUTTON, 10);
-       else
-               ((CMainFrame *) m_pMainWnd)->m_wndToolBar.SetButtonInfo(12, ID_SWITCH_RENDER, TBBS_BUTTON, 9);
-}
diff --git a/applications/osmo4_w32/Osmo4.h b/applications/osmo4_w32/Osmo4.h
deleted file mode 100644 (file)
index cb53b1d..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-// GPAC.h : main header file for the GPAC application
-//
-
-#if !defined(AFX_GPAC_H__8B06A368_E142_47E3_ABE7_0B459FC0E853__INCLUDED_)
-#define AFX_GPAC_H__8B06A368_E142_47E3_ABE7_0B459FC0E853__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#ifndef __AFXWIN_H__
-       #error include 'stdafx.h' before including this file for PCH
-#endif
-
-#include "resource.h"       // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// Osmo4:
-// See GPAC.cpp for the implementation of this class
-//
-
-
-/*GPAC terminal*/
-#include <gpac/terminal.h>
-/*GPAC terminal info (OD browsing)*/
-#include <gpac/term_info.h>
-
-enum {
-       WM_SCENE_DONE = WM_USER + 1, 
-       WM_NAVIGATE,
-       WM_SETSIZE,
-       WM_OPENURL,
-       WM_RESTARTURL,
-       WM_CONSOLEMSG,
-       WM_NEWINSTANCE,
-};
-
-const char *static_gpac_get_url();
-
-class Osmo4 : public CWinApp
-{
-public:
-       Osmo4();
-
-       GF_Terminal *m_term;
-       GF_User m_user;
-
-       Bool m_isopen, m_reset;
-       u32 max_duration;
-       Bool can_seek;
-       u32 orig_width,orig_height, m_reconnect_time; 
-
-       CString m_navigate_url;
-       void Pause();
-       void PlayFromTime(u32 time);
-
-       void SetOptions();
-       void UpdateRenderSwitch();
-       void UpdatePlayButton(Bool force_play = 0);
-
-       /*general options*/
-       Bool m_Loop, m_LookForSubtitles, m_NoConsole, m_ViewXMTA, m_SingleInstance, m_NoMimeFetch;
-       u32 start_mode;
-
-       CString GetFileFilter();
-       
-       char szApplicationPath[GF_MAX_PATH];
-       char szUserPath[GF_MAX_PATH];
-
-       FILE *m_logs;
-       u32 m_log_level, m_log_tools;
-
-       HANDLE m_hMutex;
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(Osmo4)
-       public:
-       virtual BOOL InitInstance();
-       virtual int ExitInstance();
-       //}}AFX_VIRTUAL
-
-// Implementation
-
-public:
-       //{{AFX_MSG(Osmo4)
-       afx_msg void OnOpenFile();
-       afx_msg void OnMainPause();
-       afx_msg void OnFileStep();
-       afx_msg void OnOpenUrl();
-       afx_msg void OnFileReload();
-       afx_msg void OnFileMigrate();
-       afx_msg void OnConfigReload();
-       afx_msg void OnFilePlay();
-       afx_msg void OnUpdateFilePlay(CCmdUI* pCmdUI);
-       afx_msg void OnUpdateFileStep(CCmdUI* pCmdUI);
-       afx_msg void OnFileStop();
-       afx_msg void OnUpdateFileStop(CCmdUI* pCmdUI);
-       afx_msg void OnSwitchRender();
-       afx_msg void OnAbout();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-inline Osmo4 *GetApp() { return (Osmo4 *)AfxGetApp(); }
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_GPAC_H__8B06A368_E142_47E3_ABE7_0B459FC0E853__INCLUDED_)
-       
\ No newline at end of file
diff --git a/applications/osmo4_w32/Osmo4.rc b/applications/osmo4_w32/Osmo4.rc
deleted file mode 100644 (file)
index 2241bfe..0000000
+++ /dev/null
@@ -1,872 +0,0 @@
-// Microsoft Visual C++ generated resource script.\r
-//\r
-#include "resource.h"\r
-\r
-#define APSTUDIO_READONLY_SYMBOLS\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Generated from the TEXTINCLUDE 2 resource.\r
-//\r
-#include "afxres.h"\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-#undef APSTUDIO_READONLY_SYMBOLS\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// Anglais (États-Unis) resources\r
-\r
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r
-#ifdef _WIN32\r
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r
-#pragma code_page(1252)\r
-#endif //_WIN32\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Menu\r
-//\r
-\r
-IDR_MAINFRAME MENU \r
-BEGIN\r
-    POPUP "&File"\r
-    BEGIN\r
-        MENUITEM "&Open File\tCtrl+O",          ID_FILEOPEN\r
-        MENUITEM "Open &URL\tCtrl+U",           ID_OPEN_URL\r
-        MENUITEM SEPARATOR\r
-        MENUITEM "File Propert&ies\tCtrl+I",    ID_FILE_PROP\r
-        POPUP "Streaming Cache"\r
-        BEGIN\r
-            MENUITEM "&Enable",                     ID_REC_ENABLE\r
-            MENUITEM "&Stop and Save",              ID_REC_STOP\r
-            MENUITEM "&Abort",                      ID_REC_ABORT\r
-        END\r
-        MENUITEM SEPARATOR\r
-        MENUITEM "Copy",                        ID_FILE_COPY\r
-        MENUITEM "Paste",                       ID_FILE_PASTE\r
-        MENUITEM SEPARATOR\r
-        MENUITEM "Exit",                        ID_FILE_EXIT\r
-    END\r
-    POPUP "View"\r
-    BEGIN\r
-        POPUP "Viewpoint"\r
-        BEGIN\r
-            MENUITEM "",                            ID_VIEWPORT_EMPTY\r
-        END\r
-        POPUP "&Navigation"\r
-        BEGIN\r
-            MENUITEM "Headlight",                   ID_HEADLIGHT\r
-            MENUITEM SEPARATOR\r
-            MENUITEM "&None",                       ID_NAVIGATE_NONE\r
-            MENUITEM "&Walk",                       ID_NAVIGATE_WALK\r
-            MENUITEM "&Fly",                        ID_NAVIGATE_FLY\r
-            MENUITEM "&Examine",                    ID_NAVIGATE_EXAM\r
-            MENUITEM "&Pan",                        ID_NAVIGATE_PAN\r
-            MENUITEM "&Slide",                      ID_NAVIGATE_SLIDE\r
-            MENUITEM "&Orbit",                      ID_NAVIGATE_ORBIT\r
-            MENUITEM "&VR",                         ID_NAVIGATE_VR\r
-            MENUITEM "&Game",                       ID_NAVIGATE_GAME\r
-            MENUITEM SEPARATOR\r
-            POPUP "Collision"\r
-            BEGIN\r
-                MENUITEM "Off",                         ID_COLLIDE_NONE\r
-                MENUITEM "Regular",                     ID_COLLIDE_REG\r
-                MENUITEM "Displacement",                ID_COLLIDE_DISP\r
-            END\r
-            MENUITEM "Gravity",                     ID_GRAVITY\r
-            MENUITEM SEPARATOR\r
-            MENUITEM "&Reset",                      ID_NAV_RESET\r
-        END\r
-        MENUITEM SEPARATOR\r
-        MENUITEM "&Fullscreen",                 ID_VIEW_FULLSCREEN\r
-        MENUITEM "Original &Aspect",            ID_VIEW_ORIGINAL\r
-        POPUP "Aspect &Ratio"\r
-        BEGIN\r
-            MENUITEM "&Keep Original",              ID_AR_KEEP\r
-            MENUITEM "&Fill Screen",                ID_AR_FILL\r
-            MENUITEM "Ratio 4/3",                   ID_AR_43\r
-            MENUITEM "Ratio 16/9",                  ID_AR_169\r
-        END\r
-        MENUITEM SEPARATOR\r
-        MENUITEM "Resource Usage",              ID_VIEW_CPU\r
-        MENUITEM SEPARATOR\r
-        MENUITEM "&Options",                    IDD_CONFIGURE\r
-    END\r
-    POPUP "Play"\r
-    BEGIN\r
-        POPUP "Stream &Selection"\r
-        BEGIN\r
-            POPUP "Audio"\r
-            BEGIN\r
-                MENUITEM "",                            ID_AUDIO_EMPTY\r
-            END\r
-            POPUP "Video"\r
-            BEGIN\r
-                MENUITEM "",                            ID_VIDEO_EMPTY\r
-            END\r
-            POPUP "Subtitle"\r
-            BEGIN\r
-                MENUITEM "",                            ID_SUBS_EMPTY\r
-            END\r
-            MENUITEM SEPARATOR\r
-            MENUITEM "Add Subtitle",                ID_ADD_SUBTITLE\r
-        END\r
-        POPUP "&Chapters"\r
-        BEGIN\r
-            MENUITEM "",                            ID_SETCHAP_FIRST\r
-        END\r
-        MENUITEM SEPARATOR\r
-        MENUITEM "Playlist\tCtrl+L",            ID_VIEW_PL, CHECKED\r
-        MENUITEM "&Loop Playlist",              ID_PLAYLIST_LOOP\r
-        MENUITEM SEPARATOR\r
-        MENUITEM "Play/Pause\tCtrl+P",          ID_FILE_PLAY\r
-        MENUITEM "Step-by-Step\tCtrl+S",        ID_FILE_STEP\r
-        MENUITEM "Stop",                        ID_FILE_STOP\r
-        MENUITEM SEPARATOR\r
-        MENUITEM "Reload File\tCtrl+R",         ID_FILE_RELOAD\r
-        MENUITEM SEPARATOR\r
-        MENUITEM "Clear History",               ID_CLEAR_NAV\r
-        MENUITEM "Reload Config",               ID_CONFIG_RELOAD\r
-    END\r
-    POPUP "?"\r
-    BEGIN\r
-        MENUITEM "Shortcut List",               ID_SHORTCUTS\r
-        MENUITEM "Navigation Keys",             ID_NAV_INFO\r
-        MENUITEM SEPARATOR\r
-        MENUITEM "&About ...",                  ID_H_ABOUT\r
-    END\r
-END\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Dialog\r
-//\r
-\r
-IDD_ABOUTBOX DIALOGEX 0, 0, 209, 137\r
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-EXSTYLE WS_EX_CLIENTEDGE\r
-CAPTION "Osmo4 / GPAC version X.X.X"\r
-FONT 8, "MS Sans Serif", 0, 0, 0x1\r
-BEGIN\r
-    ICON            IDR_MAINFRAME,IDC_STATIC,8,4,20,20\r
-    CTEXT           "Osmo4 Player - GPAC Multimedia Framework",IDC_STATIC,31,10,150,10,SS_NOPREFIX\r
-    CTEXT           "(c) Jean Le Feuvre 2000-2005 - (c) ENST 2005-200X\nAll Rights Reserved",IDC_STATIC,4,64,201,18\r
-    CTEXT           "This program is free software and may be distributed according to the terms of the GNU Lesser General Public License",IDC_STATIC,4,26,200,18\r
-    PUSHBUTTON      "http://gpac.sourceforge.net",IDC_GOGPAC,43,47,121,13,BS_FLAT,WS_EX_STATICEDGE\r
-    GROUPBOX        "With Many Thanks To:",IDC_STATIC,3,82,203,53\r
-    CTEXT           "The FreeType Project\nMozilla SpiderMonkey (JavaScript support)\n\nZLIB, the PNG Group, the I.J.G.\nFFMPEG, FAAD, XVID, MAD",IDC_STATIC,9,92,189,41\r
-END\r
-\r
-IDD_PASSWD DIALOG  0, 0, 134, 71\r
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Enter user name and password"\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    DEFPUSHBUTTON   "OK",IDOK,4,56,50,12\r
-    PUSHBUTTON      "Cancel",IDCANCEL,80,56,50,12\r
-    LTEXT           "Static__________________________",IDC_TXT_SITE,25,4,105,8\r
-    LTEXT           "Login",IDC_STATIC,7,21,18,8\r
-    LTEXT           "Password",IDC_STATIC,7,37,32,8\r
-    EDITTEXT        IDC_EDIT_USER,47,18,55,14,ES_AUTOHSCROLL\r
-    EDITTEXT        IDC_EDIT_PASSWORD,47,34,55,14,ES_PASSWORD | ES_AUTOHSCROLL\r
-    LTEXT           "Site",IDC_STATIC,7,4,13,8\r
-END\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Version\r
-//\r
-\r
-VS_VERSION_INFO VERSIONINFO\r
- FILEVERSION 1,0,0,1\r
- PRODUCTVERSION 1,0,0,1\r
- FILEFLAGSMASK 0x3fL\r
-#ifdef _DEBUG\r
- FILEFLAGS 0x1L\r
-#else\r
- FILEFLAGS 0x0L\r
-#endif\r
- FILEOS 0x4L\r
- FILETYPE 0x1L\r
- FILESUBTYPE 0x0L\r
-BEGIN\r
-    BLOCK "StringFileInfo"\r
-    BEGIN\r
-        BLOCK "040904b0"\r
-        BEGIN\r
-            VALUE "FileDescription", "Osmo4-GPAC"\r
-            VALUE "FileVersion", "0.4.5"\r
-            VALUE "InternalName", "Osmo4"\r
-            VALUE "LegalCopyright", "Copyright (C) 2005"\r
-            VALUE "OriginalFilename", "Osmo4.EXE"\r
-            VALUE "ProductName", "Osmo4-GPAC"\r
-            VALUE "ProductVersion", "0.4.5"\r
-        END\r
-    END\r
-    BLOCK "VarFileInfo"\r
-    BEGIN\r
-        VALUE "Translation", 0x409, 1200\r
-    END\r
-END\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// DESIGNINFO\r
-//\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-GUIDELINES DESIGNINFO \r
-BEGIN\r
-    IDD_ABOUTBOX, DIALOG\r
-    BEGIN\r
-        BOTTOMMARGIN, 136\r
-    END\r
-END\r
-#endif    // APSTUDIO_INVOKED\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Toolbar\r
-//\r
-\r
-IDR_MAINTOOLS TOOLBAR  16, 15\r
-BEGIN\r
-    BUTTON      ID_FILEOPEN\r
-    BUTTON      ID_NAV_PREV\r
-    BUTTON      ID_NAV_NEXT\r
-    BUTTON      ID_FILE_PLAY\r
-    BUTTON      ID_FILE_PLAY\r
-    BUTTON      ID_FILE_STEP\r
-    BUTTON      ID_FILE_STOP\r
-    BUTTON      ID_FILE_PROPS\r
-    BUTTON      IDD_CONFIGURE\r
-    BUTTON      ID_SWITCH_RENDER\r
-    BUTTON      ID_SWITCH_RENDER\r
-END\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Bitmap\r
-//\r
-\r
-IDR_MAINTOOLS           BITMAP                  "res\\maintool.bmp"\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// String Table\r
-//\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    IDR_MAINFRAME           "Osmo4"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    AFX_IDS_APP_TITLE       "Osmo4"\r
-    AFX_IDS_IDLEMESSAGE     "Ready"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    ID_FILE_EXIT            "Quit the application; prompts to save documents\nExit"\r
-    ID_H_ABOUT              "Display program information, version number and copyright\nAbout"\r
-    ID_PLAYLIST_LOOP        "Restarts playlist from begining when playlist is over"\r
-    ID_FILEOPEN             "Opens local file"\r
-    ID_VIEW_ORIGINAL        "restore Original Aspect of presentation"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    ID_VIEW_STATUS_BAR      "Show or hide the status bar\nToggle StatusBar"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    AFX_IDS_SCSIZE          "Change the window size"\r
-    AFX_IDS_SCMOVE          "Change the window position"\r
-    AFX_IDS_SCMINIMIZE      "Reduce the window to an icon"\r
-    AFX_IDS_SCMAXIMIZE      "Enlarge the window to full size"\r
-    AFX_IDS_SCNEXTWINDOW    "Switch to the next document window"\r
-    AFX_IDS_SCPREVWINDOW    "Switch to the previous document window"\r
-    AFX_IDS_SCCLOSE         "Close the active window and prompts to save the documents"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    AFX_IDS_SCRESTORE       "Restore the window to normal size"\r
-    AFX_IDS_SCTASKLIST      "Activate Task List"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    ID_FILE_STOP            "Stops current presentation"\r
-    ID_SWITCH_RENDER        "Switch between 2D and 3D renderers"\r
-    ID_COLLIDE_NONE         "Turns collision detection off"\r
-    ID_COLLIDE_REG          "Turns collision detection on"\r
-    ID_COLLIDE_DISP         "Collision with camera displacement"\r
-    ID_HEADLIGHT            "Turns headlight on/off"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    ID_CLEAR_NAV            "Clears navigation history"\r
-    ID_TIMER                " "\r
-    ID_FPS                  " "\r
-    ID_VIEW_PL              "View navigation history as a playlist"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    ID_VIEW_FULLSCREEN      "Move to Full Screen mode (Esc to exit)"\r
-    ID_AR_KEEP              "Keep Aspect Ratio of presentation"\r
-    ID_SHORTCUTS            "List of available shortcuts"\r
-    ID_FILE_PROP            "Show presentation properties"\r
-    ID_FILE_STEP            "Step one frame into presentation"\r
-    IDD_CONFIGURE           "Configure Player"\r
-    ID_VIEW_SCALABLE        "Uses vectorial zooming when resizing the window"\r
-    ID_OPEN_URL             "Open remote presentation"\r
-    ID_FILE_RELOAD          "Reload current presentation"\r
-    ID_FILE_PLAY            "Play/Pause presentation"\r
-    ID_NAVIGATE_NONE        "Disable navigation"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    ID_NAVIGATE_WALK        "Turn walk navigation on"\r
-    ID_AR_FILL              "Ignores Aspect Ratio and always fill screen"\r
-    ID_AR_43                "Forces Aspect Ratio of 4/3"\r
-    ID_AR_169               "Forces Aspect Ratio of 16/9"\r
-    ID_NAV_RESET            "Restore last viewpoint"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    ID_NAVIGATE_VR          "QT-VR like navigation"\r
-    ID_REC_ENABLE           "Enable recording of streaming data"\r
-    ID_REC_STOP             "Stops recording and save to file"\r
-    ID_REC_ABORT            "Stops recording and discard data"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    ID_FILE_COPY            "Copy selected text to clipboard"\r
-    ID_FILE_PASTE           "Paste clipboard"\r
-END\r
-\r
-#endif    // Anglais (États-Unis) resources\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// Français (France) resources\r
-\r
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)\r
-#ifdef _WIN32\r
-LANGUAGE LANG_FRENCH, SUBLANG_FRENCH\r
-#pragma code_page(1252)\r
-#endif //_WIN32\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Dialog\r
-//\r
-\r
-IDD_OPENFILE DIALOG  0, 0, 301, 23\r
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Select Location"\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    COMBOBOX        IDC_COMBOURL,3,5,273,67,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP\r
-    DEFPUSHBUTTON   "OK",IDC_BUTGO,279,5,19,13\r
-END\r
-\r
-IDD_OPTIONS DIALOG  0, 0, 174, 106\r
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Osmo4 Options"\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    PUSHBUTTON      "Apply",IDC_SAVEOPT,147,2,26,12\r
-    COMBOBOX        IDC_SELECT,42,2,99,173,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    LTEXT           "Category",IDC_STATIC,7,4,29,8\r
-END\r
-\r
-IDD_OPT_GEN DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    CONTROL         "Loop At End",IDC_LOOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,4,55,10\r
-    CONTROL         "Look for subtitles",IDC_LOOKFORSUB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,42,69,10\r
-    CONTROL         "Disable console messages",IDC_NO_CONSOLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,17,99,10\r
-    CONTROL         "View Graph in XMT-A format",IDC_DUMP_XMT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,30,105,10\r
-    CONTROL         "Single Instance",IDC_SINGLE_INSTANCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,54,65,10\r
-END\r
-\r
-IDD_OPT_RENDER DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    LTEXT           "Rendering Frame Rate",IDC_STATIC,5,4,72,8\r
-    COMBOBOX        IDC_BIFS_RATE,81,2,84,55,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "Fast Rendering",IDC_FAST_RENDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,49,64,10\r
-    CONTROL         "Force Scene Size",IDC_FORCE_SIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,96,49,72,10\r
-    LTEXT           "Anti-Aliasing Level",IDC_STATIC,7,20,58,8\r
-    COMBOBOX        IDC_AA_LIST,81,17,84,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "Use 3D Renderer",IDC_USE_RENDER3D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,63,71,10\r
-    LTEXT           "2D Rasterizer",IDC_STATIC,7,35,44,8\r
-    COMBOBOX        IDC_GD_LIST,81,33,84,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    COMBOBOX        IDC_DRAW_BOUNDS,109,60,56,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    LTEXT           "Bounds",IDC_STATIC,82,64,25,8\r
-END\r
-\r
-IDD_OPT_AUDIO DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_THICKFRAME\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    CONTROL         "Spin1",IDC_SPIN_AUDIO,"msctls_updown32",UDS_SETBUDDYINT | UDS_ARROWKEYS,27,15,11,14\r
-    EDITTEXT        IDC_EDIT_AUDIO,5,15,19,14,ES_READONLY | ES_NUMBER\r
-    CONTROL         "Force Audio Config",IDC_FORCE_AUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,3,73,10\r
-    LTEXT           "buffers",IDC_STATIC,43,18,23,8\r
-    CONTROL         "Spin1",IDC_SPIN_FPS,"msctls_updown32",UDS_SETBUDDYINT | UDS_ARROWKEYS,104,15,11,14\r
-    EDITTEXT        IDC_AUDIO_FPS,77,15,24,14,ES_NUMBER\r
-    LTEXT           "Audio Driver",IDC_STATIC,7,63,40,8\r
-    CONTROL         "No Resynchronization",IDC_AUDIO_RESYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,46,82,10\r
-    COMBOBOX        IDC_DRIVER_LIST,63,60,103,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "Disable Notifications",IDC_AUDIO_NOTIFS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,47,79,10\r
-    CONTROL         "Disable Multichannel",IDC_AUDIO_MULTICH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,34,81,10\r
-    LTEXT           "ms total length",IDC_STATIC,118,18,49,8\r
-END\r
-\r
-IDD_OPT_VIDEO DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    LTEXT           "Video Driver",IDC_STATIC,6,7,40,8\r
-    COMBOBOX        IDC_VIDEO_LIST,55,5,111,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "Change video resolution in fullscreen",IDC_SWITCH_RES,\r
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,29,131,10\r
-    CONTROL         "Use Hardware Video Memory in 2D mode",IDC_HWMEMORY,\r
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,44,143,10\r
-END\r
-\r
-IDD_OPT_HTTP DIALOGEX 0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif", 0, 0, 0x0\r
-BEGIN\r
-    PUSHBUTTON      "...",IDC_BROWSE_CACHE,57,4,109,12\r
-    CONTROL         "Clean cache at exit",IDC_CLEAN_CACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,87,23,77,10\r
-    CONTROL         "Disable Cache",IDC_RESTART_CACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,22,62,10\r
-    LTEXT           "Cache Directory",IDC_STATIC,5,5,52,8\r
-    CONTROL         "XML progressive load",IDC_SAX_PROGRESSIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,42,84,10\r
-    EDITTEXT        IDC_SAX_DELAY,142,41,22,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER\r
-    LTEXT           "TimeSlice (ms)",IDC_STATIC,91,43,46,8\r
-    EDITTEXT        IDC_HTTP_PROXY,54,58,111,12,ES_AUTOHSCROLL\r
-    CONTROL         "Use proxy",IDC_HTTP_USE_PROXY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,59,47,10\r
-END\r
-\r
-IDD_OPT_FONT DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    LTEXT           "Font Engine",IDC_STATIC,6,11,39,8\r
-    COMBOBOX        IDC_FONT_LIST,60,8,105,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    PUSHBUTTON      "...",IDC_BROWSE_FONT,2,40,164,12\r
-    LTEXT           "System Font Directory",IDC_STATIC,46,29,70,8\r
-    COMBOBOX        IDC_TEXTURE_MODE,101,58,64,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    LTEXT           "Text Texturing Mode",IDC_STATIC,7,60,69,8\r
-END\r
-\r
-IDD_OPT_SYSTEMS DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    COMBOBOX        IDC_LANG,75,4,92,58,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    LTEXT           "Prefered Language for stream selection",IDC_STATIC,3,3,61,17\r
-    LTEXT           "Decoder Threading",IDC_STATIC,4,28,62,8\r
-    COMBOBOX        IDC_DEC_THREAD,75,25,92,57,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "Always draw late BIFS frames",IDC_BIFSDROP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,43,109,10\r
-    CONTROL         "Force Single Timeline",IDC_FORCE_DURATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,58,83,10\r
-END\r
-\r
-IDD_OPT_STREAM DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    LTEXT           "Default Port",IDC_STATIC,6,6,40,8\r
-    COMBOBOX        IDC_PORT,52,3,113,61,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "RTP over RTSP",IDC_RTSP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,19,68,10\r
-    CONTROL         "use RTP reordering",IDC_REORDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,81,19,76,10\r
-    LTEXT           "milliseconds before control timeout",IDC_STATIC,38,34,108,8\r
-    EDITTEXT        IDC_TIMEOUT,3,32,30,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER\r
-    LTEXT           "milliseconds of Media Buffering ",IDC_STATIC,38,48,100,8\r
-    EDITTEXT        IDC_BUFFER,3,47,30,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER\r
-    EDITTEXT        IDC_REBUFFER_LEN,83,60,30,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER\r
-    CONTROL         "Rebuffer if less than",IDC_REBUFFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,63,79,10\r
-    LTEXT           "milliseconds",IDC_STATIC,117,63,41,8\r
-END\r
-\r
-IDD_PROPERTIES DIALOGEX 0, 0, 338, 150\r
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Presentation Properties"\r
-FONT 8, "MS Sans Serif", 0, 0, 0x1\r
-BEGIN\r
-    CONTROL         "Tree1",IDC_ODTREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | WS_BORDER | WS_TABSTOP | 0x400,2,2,120,114\r
-    EDITTEXT        IDC_ODINFO,123,17,213,130,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_NOHIDESEL | ES_OEMCONVERT | ES_READONLY | WS_VSCROLL | WS_HSCROLL,WS_EX_DLGMODALFRAME | WS_EX_STATICEDGE\r
-    PUSHBUTTON      "Get World Info",IDC_WORLD,2,118,119,13\r
-    PUSHBUTTON      "View Scene Graph",IDC_VIEWSG,2,134,119,13\r
-    CONTROL         "Tab1",IDC_VIEWSEL,"SysTabControl32",TCS_BUTTONS,124,2,208,14\r
-END\r
-\r
-IDD_OPT_DECODER DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    LTEXT           "Prefered Audio Module",-1,46,5,69,8\r
-    COMBOBOX        IDC_AUDEC_LIST,26,17,111,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    LTEXT           "Prefered Video Module",-1,48,40,69,8\r
-    COMBOBOX        IDC_VIDEC_LIST,25,52,113,55,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-END\r
-\r
-IDD_OPT_RENDER2D DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    CONTROL         "Disable YUV Hardware",IDC_YUV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,54,89,10\r
-    LTEXT           "Static",IDC_FORMAT_YUV,97,57,67,8\r
-    CONTROL         "Direct Rendering",IDC_DIRECTRENDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,32,72,10\r
-    CONTROL         "Scalable Zoom",IDC_ZOOM_SCALABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,10,77,10\r
-END\r
-\r
-IDD_OPT_RENDER3D DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    CONTROL         "Use OpenGL Outlines",IDC_RASTER_OUTLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,2,84,10\r
-    CONTROL         "Emulate power-of-two textures for video",IDC_EMUL_POW2,\r
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,45,140,10\r
-    CONTROL         "Polygon Anti-Aliasing",IDC_DISABLE_POLY_AA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,90,2,78,10\r
-    CONTROL         "Disable rectangular texture extensions",IDC_DISABLE_TX_RECT,\r
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,55,135,10\r
-    CONTROL         "Bitmap node uses direct pixel copy",IDC_BITMAP_USE_PIXEL,\r
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,65,125,10\r
-    LTEXT           "Draw Normals",IDC_STATIC,4,17,45,8\r
-    COMBOBOX        IDC_DRAW_NORMALS,4,25,48,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    LTEXT           "Backface Cull",IDC_STATIC,57,17,55,8\r
-    COMBOBOX        IDC_BACK_CULL,57,25,47,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    LTEXT           "Draw Mode",IDC_STATIC,113,17,55,8\r
-    COMBOBOX        IDC_DRAW_MODE,111,25,53,44,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-END\r
-\r
-IDD_SLIDERS DIALOG  0, 0, 218, 18\r
-STYLE DS_SETFONT | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    CONTROL         "Slider1",ID_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,0,3,185,12\r
-    CONTROL         "Slider1",ID_AUDIO_VOL,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_BORDER | WS_TABSTOP,187,3,30,13\r
-END\r
-\r
-IDD_NAVBAR DIALOGEX 0, 0, 279, 15\r
-STYLE DS_SETFONT | WS_CHILD\r
-FONT 8, "MS Sans Serif", 0, 0, 0x1\r
-BEGIN\r
-    COMBOBOX        IDC_ADDRESS,29,1,130,196,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP,WS_EX_ACCEPTFILES\r
-    LTEXT           "Address",IDC_DUMTXT,1,4,26,8\r
-END\r
-\r
-IDD_PLAYLIST DIALOGEX 0, 0, 186, 54\r
-STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME\r
-EXSTYLE WS_EX_TOOLWINDOW\r
-CAPTION "Osmo4 Playlist"\r
-FONT 8, "MS Sans Serif", 0, 0, 0x1\r
-BEGIN\r
-    CONTROL         "List4",IDC_FILELIST,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,1,0,182,51\r
-END\r
-\r
-IDD_OPT_MCACHE DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    PUSHBUTTON      "...",IDC_BROWSE_MCACHE,41,2,126,12\r
-    CONTROL         "Overwrite existing files",IDC_MCACHE_OVERWRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,18,85,10\r
-    CONTROL         "Use filename",IDC_MCACHE_USENAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,31,57,10\r
-    LTEXT           "Record To",IDC_STATIC,4,4,35,8\r
-    EDITTEXT        IDC_BASEPRES,81,31,82,12,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER\r
-END\r
-\r
-IDD_OPT_FILETYPES DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    COMBOBOX        IDC_FILELIST,59,6,108,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    LTEXT           "Supported Files",IDC_STATIC,6,8,50,8\r
-    LTEXT           "Extension",IDC_FILES_EXT,7,25,154,8\r
-    LTEXT           "Mime Type",IDC_FILES_MIMES,7,37,156,8\r
-    CONTROL         "Associate with Osmo4",IDC_ASSOCIATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,60,84,10\r
-    LTEXT           "Plugin",IDC_FILES_PLUG,8,49,154,8\r
-END\r
-\r
-IDD_OPT_LOGS DIALOG  0, 20, 169, 76\r
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTROL | WS_CHILD\r
-FONT 8, "MS Sans Serif"\r
-BEGIN\r
-    LTEXT           "Level",IDC_STATIC,6,7,18,8\r
-    COMBOBOX        IDC_LOG_LEVEL,30,4,64,74,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "core",IDC_TOOL_CORE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,23,30,10\r
-    CONTROL         "coding",IDC_TOOL_CODING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,33,37,10\r
-    CONTROL         "container",IDC_TOOL_CONTAINER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,43,45,10\r
-    CONTROL         "network",IDC_TOOL_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,53,41,10\r
-    CONTROL         "rtp",IDC_TOOL_RTP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,63,24,10\r
-    CONTROL         "author",IDC_TOOL_AUTHOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,24,36,10\r
-    CONTROL         "sync",IDC_TOOL_SYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,34,31,10\r
-    CONTROL         "codec",IDC_TOOL_CODEC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,44,36,10\r
-    CONTROL         "parser",IDC_TOOL_PARSER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,54,35,10\r
-    CONTROL         "media",IDC_TOOL_MEDIA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,64,35,10\r
-    CONTROL         "scene",IDC_TOOL_SCENE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,86,24,35,10\r
-    CONTROL         "script",IDC_TOOL_SCRIPT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,86,34,33,10\r
-    CONTROL         "compose",IDC_TOOL_COMPOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,86,44,45,10\r
-    CONTROL         "render",IDC_TOOL_RENDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,86,54,36,10\r
-    CONTROL         "mmio",IDC_TOOL_MMIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,86,64,32,10\r
-END\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// DESIGNINFO\r
-//\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-GUIDELINES DESIGNINFO \r
-BEGIN\r
-    IDD_OPT_VIDEO, DIALOG\r
-    BEGIN\r
-        RIGHTMARGIN, 168\r
-    END\r
-\r
-    IDD_OPT_FONT, DIALOG\r
-    BEGIN\r
-        LEFTMARGIN, 1\r
-        RIGHTMARGIN, 168\r
-        BOTTOMMARGIN, 74\r
-    END\r
-\r
-    IDD_OPT_SYSTEMS, DIALOG\r
-    BEGIN\r
-        RIGHTMARGIN, 167\r
-        TOPMARGIN, 1\r
-        BOTTOMMARGIN, 75\r
-    END\r
-\r
-    IDD_OPT_STREAM, DIALOG\r
-    BEGIN\r
-        LEFTMARGIN, 1\r
-        RIGHTMARGIN, 167\r
-        TOPMARGIN, 1\r
-    END\r
-\r
-    IDD_PROPERTIES, DIALOG\r
-    BEGIN\r
-        RIGHTMARGIN, 335\r
-        TOPMARGIN, 1\r
-    END\r
-\r
-    IDD_OPT_DECODER, DIALOG\r
-    BEGIN\r
-        RIGHTMARGIN, 168\r
-    END\r
-\r
-    IDD_OPT_RENDER3D, DIALOG\r
-    BEGIN\r
-        RIGHTMARGIN, 168\r
-    END\r
-\r
-    IDD_NAVBAR, DIALOG\r
-    BEGIN\r
-        RIGHTMARGIN, 167\r
-    END\r
-\r
-    IDD_OPT_FILETYPES, DIALOG\r
-    BEGIN\r
-        RIGHTMARGIN, 168\r
-    END\r
-\r
-    IDD_OPT_LOGS, DIALOG\r
-    BEGIN\r
-        RIGHTMARGIN, 168\r
-    END\r
-END\r
-#endif    // APSTUDIO_INVOKED\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Toolbar\r
-//\r
-\r
-IDR_PLAYLIST TOOLBAR  16, 15\r
-BEGIN\r
-    BUTTON      ID_PL_OPEN\r
-    BUTTON      ID_PL_SAVE\r
-    BUTTON      ID_PL_ADD_FILE\r
-    BUTTON      ID_PL_REM_FILE\r
-    BUTTON      ID_PL_UP\r
-    BUTTON      ID_PL_DOWN\r
-    BUTTON      ID_PL_SORT_FILE\r
-END\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Bitmap\r
-//\r
-\r
-IDR_PLAYLIST            BITMAP                  "res\\playlist.bmp"\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// TEXTINCLUDE\r
-//\r
-\r
-1 TEXTINCLUDE \r
-BEGIN\r
-    "resource.h\0"\r
-END\r
-\r
-2 TEXTINCLUDE \r
-BEGIN\r
-    "#include ""afxres.h""\r\n"\r
-    "\0"\r
-END\r
-\r
-3 TEXTINCLUDE \r
-BEGIN\r
-    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"\r
-    "#define _AFX_NO_OLE_RESOURCES\r\n"\r
-    "#define _AFX_NO_TRACKER_RESOURCES\r\n"\r
-    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"\r
-    "\r\n"\r
-    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"\r
-    "#ifdef _WIN32\r\n"\r
-    "LANGUAGE 9, 1\r\n"\r
-    "#pragma code_page(1252)\r\n"\r
-    "#endif //_WIN32\r\n"\r
-    "#include ""res\\Osmo4.rc2""  // non-Microsoft Visual C++ edited resources\r\n"\r
-    "#include ""afxres.rc""         // Standard components\r\n"\r
-    "#endif\r\n"\r
-    "\0"\r
-END\r
-\r
-#endif    // APSTUDIO_INVOKED\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Icon\r
-//\r
-\r
-// Icon with lowest ID value placed first to ensure application icon\r
-// remains consistent on all systems.\r
-IDR_MAINFRAME           ICON                    "..\\..\\doc\\osmo4.ico"\r
-IDI_PLAY                ICON                    "res\\play.ico"\r
-IDI_STOP                ICON                    "res\\stop.ico"\r
-IDI_PAUSE               ICON                    "res\\pause.ico"\r
-IDI_MESSAGE             ICON                    "res\\message.ico"\r
-IDI_ERR                 ICON                    "res\\error.ico"\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Dialog Info\r
-//\r
-\r
-IDD_OPT_RENDER DLGINIT\r
-BEGIN\r
-    IDC_BIFS_RATE, 0x403, 4, 0\r
-0x2e35, 0x0030, \r
-    IDC_BIFS_RATE, 0x403, 4, 0\r
-0x2e37, 0x0035, \r
-    IDC_BIFS_RATE, 0x403, 5, 0\r
-0x3031, 0x302e, "\000" \r
-    IDC_BIFS_RATE, 0x403, 5, 0\r
-0x3231, 0x352e, "\000" \r
-    IDC_BIFS_RATE, 0x403, 5, 0\r
-0x3531, 0x302e, "\000" \r
-    IDC_BIFS_RATE, 0x403, 5, 0\r
-0x3432, 0x302e, "\000" \r
-    IDC_BIFS_RATE, 0x403, 5, 0\r
-0x3532, 0x302e, "\000" \r
-    IDC_BIFS_RATE, 0x403, 5, 0\r
-0x3033, 0x302e, "\000" \r
-    0\r
-END\r
-\r
-IDD_OPT_SYSTEMS DLGINIT\r
-BEGIN\r
-    IDC_LANG, 0x403, 8, 0\r
-0x6e45, 0x6c67, 0x7369, 0x0068, \r
-    IDC_LANG, 0x403, 7, 0\r
-0x7246, 0x6e65, 0x6863, "\000" \r
-    IDC_LANG, 0x403, 7, 0\r
-0x6547, 0x6d72, 0x6e61, "\000" \r
-    IDC_LANG, 0x403, 8, 0\r
-0x7449, 0x6c61, 0x6169, 0x006e, \r
-    IDC_LANG, 0x403, 8, 0\r
-0x7053, 0x6e61, 0x7369, 0x0068, \r
-    IDC_LANG, 0x403, 9, 0\r
-0x6843, 0x6e69, 0x6565, 0x6573, "\000" \r
-    IDC_LANG, 0x403, 10, 0\r
-0x614a, 0x6170, 0x656e, 0x7365, 0x0065, \r
-    IDC_DEC_THREAD, 0x403, 14, 0\r
-0x6953, 0x676e, 0x656c, 0x5420, 0x7268, 0x6165, 0x0064, \r
-    IDC_DEC_THREAD, 0x403, 13, 0\r
-0x754d, 0x6c74, 0x2069, 0x6854, 0x6572, 0x6461, "\000" \r
-    IDC_DEC_THREAD, 0x403, 5, 0\r
-0x7246, 0x6565, "\000" \r
-    0\r
-END\r
-\r
-IDD_OPT_LOGS DLGINIT\r
-BEGIN\r
-    IDC_LOG_LEVEL, 0x403, 9, 0\r
-0x6944, 0x6173, 0x6c62, 0x6465, "\000" \r
-    IDC_LOG_LEVEL, 0x403, 6, 0\r
-0x7245, 0x6f72, 0x0072, \r
-    IDC_LOG_LEVEL, 0x403, 8, 0\r
-0x6157, 0x6e72, 0x6e69, 0x0067, \r
-    IDC_LOG_LEVEL, 0x403, 5, 0\r
-0x6e49, 0x6f66, "\000" \r
-    IDC_LOG_LEVEL, 0x403, 6, 0\r
-0x6544, 0x7562, 0x0067, \r
-    0\r
-END\r
-\r
-#endif    // Français (France) resources\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-\r
-\r
-#ifndef APSTUDIO_INVOKED\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Generated from the TEXTINCLUDE 3 resource.\r
-//\r
-#define _AFX_NO_SPLITTER_RESOURCES\r
-#define _AFX_NO_OLE_RESOURCES\r
-#define _AFX_NO_TRACKER_RESOURCES\r
-#define _AFX_NO_PROPERTY_RESOURCES\r
-\r
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r
-#ifdef _WIN32\r
-LANGUAGE 9, 1\r
-#pragma code_page(1252)\r
-#endif //_WIN32\r
-#include "res\Osmo4.rc2"  // non-Microsoft Visual C++ edited resources\r
-#include "afxres.rc"         // Standard components\r
-#endif\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-#endif    // not APSTUDIO_INVOKED\r
-\r
diff --git a/applications/osmo4_w32/Playlist.cpp b/applications/osmo4_w32/Playlist.cpp
deleted file mode 100644 (file)
index e06bfdd..0000000
+++ /dev/null
@@ -1,941 +0,0 @@
-// Playlist.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "osmo4.h"
-#include "MainFrm.h"
-#include "OpenURL.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// Playlist dialog
-
-PLEntry::PLEntry(CString url, char *path)
-{
-       if (!path || strrchr(url, '\\') || strstr(url, "://")) {
-               m_url = gf_strdup(url);
-       } else {
-               char szPath[MAX_PATH];
-               strcpy(szPath, path);
-               strcat(szPath, url);
-               m_url = gf_strdup(szPath);
-       }
-       char *str = (char *) strrchr(url, '\\');
-       if (!str) str = (char *) strrchr(url, '/');
-       if (str && strlen(str+1)) {
-               m_disp_name = gf_strdup(str+1);
-               str = strrchr(m_disp_name, '.');
-               if (str) str[0] = 0;
-       } else {
-               str = (char *) strstr(url, "://");
-               if (str) {
-                       str += 3;
-                       m_disp_name = gf_strdup(str);
-               } else {
-                       m_disp_name = gf_strdup(url);
-                       str = strrchr(m_disp_name, '.');
-                       if (str) str[0] = 0;
-               }
-       }
-       m_duration = 0;
-       m_bIsDead = 0;
-       m_bIsPlaying = 0;
-       m_bIsSelected = 0;
-}
-
-PLEntry::~PLEntry()
-{
-       if (m_url) gf_free(m_url);
-       if (m_disp_name) gf_free(m_disp_name);
-
-}
-
-
-static char szCacheDir[MAX_PATH];
-
-Playlist::Playlist()
-       : CDialog(Playlist::IDD, NULL)
-{
-       //{{AFX_DATA_INIT(Playlist)
-       //}}AFX_DATA_INIT
-
-       m_entries = gf_list_new();
-       m_cur_entry = -1;
-       m_all_dead_entries=-1;
-       GetCurrentDirectory(MAX_PATH, szCacheDir);
-}
-
-Playlist::~Playlist()
-{
-       Clear();
-       gf_list_del(m_entries);
-}
-
-void Playlist::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(Playlist)
-       DDX_Control(pDX, IDC_FILELIST, m_FileList);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(Playlist, CDialog)
-       //{{AFX_MSG_MAP(Playlist)
-       ON_WM_SIZE()
-       ON_COMMAND(ID_PL_ADD_FILE, OnPlAddFile)
-       ON_COMMAND(ID_PL_REM_FILE, OnPlRemFile)
-       ON_COMMAND(ID_PL_UP, OnSelUp)
-       ON_COMMAND(ID_PL_DOWN, OnSelDown)
-       ON_COMMAND(ID_PL_SAVE, OnPlSave)
-       ON_WM_DROPFILES()
-       ON_WM_CLOSE()
-       ON_WM_DESTROY()
-       ON_COMMAND(ID_PL_REM_DEAD, OnPlRemDead)
-       ON_COMMAND(ID_PL_REM_ALL, OnPlRemAll)
-       ON_COMMAND(ID_PL_ADD_DIR, OnPlAddDir)
-       ON_COMMAND(ID_PL_ADD_DIR_REC, OnPlAddDirRec)
-       ON_COMMAND(ID_PL_ADD_URL, OnPlAddUrl)
-       ON_COMMAND(ID_PL_OPEN, OnPlOpen)
-       ON_COMMAND(ID_PL_PLAY, OnPlPlay)
-       ON_COMMAND(ID_PL_SEL_REV, OnReverseSelection)
-       ON_COMMAND(ID_PL_SORT_REV, OnReverseList)
-       ON_COMMAND(ID_PL_RANDOM, OnRandomize)
-       ON_COMMAND(ID_PL_SORT_TITLE, OnSortTitle)
-       ON_COMMAND(ID_PL_SORT_FILE, OnSortFile)
-       ON_COMMAND(ID_PL_SORT_DUR, OnSortDuration)
-       ON_NOTIFY(NM_RCLICK, IDC_FILELIST, OnRclickFilelist)
-       ON_NOTIFY(NM_DBLCLK, IDC_FILELIST, OnDblclkFilelist)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// Playlist message handlers
-
-BOOL Playlist::OnInitDialog() 
-{
-       UINT buttonArray[50];
-       TBBUTTONINFO bi;
-       u32 *ba;
-       CDialog::OnInitDialog();
-
-       
-       SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), TRUE);
-       SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE);
-
-       if (!m_toolBar.CreateEx(this, WS_CHILD | CBRS_TOP | CBRS_FLYBY) ||
-               !m_toolBar.LoadBitmap(IDR_PLAYLIST))
-       {
-               TRACE0("Failed to create toolbar\n");
-               return 0;
-       }
-       
-       ba = &buttonArray[0];
-       *ba = ID_PL_OPEN; ba++;
-       *ba = ID_PL_SAVE; ba++;
-       *ba = ID_SEPARATOR; ba++;
-       *ba = ID_PL_ADD_FILE; ba++;
-       *ba = ID_PL_REM_FILE; ba++;
-       *ba = ID_SEPARATOR; ba++;
-       *ba = ID_PL_UP; ba++;
-       *ba = ID_PL_DOWN; ba++;
-       *ba = ID_SEPARATOR; ba++;
-       *ba = ID_PL_SORT_FILE; ba++;
-       m_toolBar.SetButtons(buttonArray, 9);
-       m_toolBar.SetButtonInfo(0, ID_PL_OPEN, TBBS_BUTTON, 0);
-       m_toolBar.SetButtonInfo(1, ID_PL_SAVE, TBBS_BUTTON, 1);
-       m_toolBar.SetButtonInfo(2, ID_SEPARATOR, TBBS_SEPARATOR, 0);
-       m_toolBar.SetButtonInfo(3, ID_PL_ADD_FILE, TBBS_DROPDOWN | TBBS_BUTTON, 2);
-       m_toolBar.SetButtonInfo(4, ID_PL_REM_FILE, TBBS_DROPDOWN | TBBS_BUTTON, 3);
-       m_toolBar.SetButtonInfo(5, ID_SEPARATOR, TBBS_SEPARATOR, 0);
-       m_toolBar.SetButtonInfo(6, ID_PL_UP, TBBS_BUTTON, 4);
-       m_toolBar.SetButtonInfo(7, ID_PL_DOWN, TBBS_BUTTON, 5);
-//     m_toolBar.SetButtonInfo(8, ID_SEPARATOR, TBBS_SEPARATOR, 0);
-       m_toolBar.SetButtonInfo(8, ID_PL_SORT_FILE, TBBS_DROPDOWN | TBBS_BUTTON, 6);
-
-       CToolBarCtrl &ctrl = m_toolBar.GetToolBarCtrl();
-       ctrl.SetStyle(TBSTYLE_FLAT | TBSTYLE_DROPDOWN);
-       ctrl.SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);
-
-       memset(&bi, 0, sizeof(bi));
-       bi.cbSize = sizeof(bi);
-       ctrl.GetButtonInfo(3, &bi);
-       bi.fsStyle |= TBSTYLE_DROPDOWN;
-       ctrl.SetButtonInfo(ID_PL_ADD_FILE, &bi);
-
-       memset(&bi, 0, sizeof(bi));
-       bi.cbSize = sizeof(bi);
-       ctrl.GetButtonInfo(4, &bi);
-       bi.fsStyle |= TBBS_DROPDOWN | TBSTYLE_DROPDOWN;
-       ctrl.SetButtonInfo(ID_PL_REM_FILE, &bi);
-
-       memset(&bi, 0, sizeof(bi));
-       bi.cbSize = sizeof(bi);
-       ctrl.GetButtonInfo(9, &bi);
-       bi.fsStyle |= TBSTYLE_DROPDOWN;
-       ctrl.SetButtonInfo(ID_PL_SORT_FILE, &bi);
-
-       m_FileList.InsertColumn(0, "", LVCFMT_LEFT, 30, 0);
-       m_FileList.InsertColumn(1, "Title", LVCFMT_LEFT, 200, 1);
-       m_FileList.InsertColumn(2, "Duration", LVCFMT_LEFT, 200, 2);
-
-
-       m_toolBar.UpdateWindow();
-       m_toolBar.ShowWindow(SW_SHOW);
-
-       SetWindowPos(NULL, 0, 0, 400, 600, SWP_NOZORDER | SWP_NOMOVE);
-
-       PostMessage(WM_NULL);
-       DragAcceptFiles();
-
-       return TRUE;  
-}
-
-void Playlist::OnSize(UINT nType, int cx, int cy) 
-{
-       u32 tool_h;
-       CDialog::OnSize(nType, cx, cy);
-       RECT rc;
-       if (!m_toolBar.m_hWnd) return;
-       if (!m_FileList.m_hWnd) return;
-
-       m_toolBar.GetClientRect(&rc);
-       tool_h = rc.bottom - rc.top;
-       m_toolBar.SetWindowPos(this, 0, 0, cx, tool_h, SWP_NOZORDER);           
-       m_FileList.SetWindowPos(this, 0, tool_h, cx, cy-tool_h, SWP_NOZORDER);          
-
-       m_FileList.SetExtendedStyle(m_FileList.GetExtendedStyle() | LVS_EX_FULLROWSELECT);
-
-       m_FileList.SetColumnWidth(0, 30);
-       m_FileList.SetColumnWidth(2, 60);
-       m_FileList.SetColumnWidth(1, cx-95);
-       
-}
-
-void Playlist::OnDropFiles(HDROP hDropInfo) 
-{
-       u32 i, count;
-       Osmo4 *app = GetApp();
-       char fileName[MAX_PATH];
-       count = ::DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0);
-       if (!count) return;
-       for (i=0; i<count; i++) {
-               ::DragQueryFile (hDropInfo, i, fileName, MAX_PATH);
-               QueueURL(fileName);
-       }
-       RefreshList();
-}
-
-
-BOOL Playlist::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) 
-{
-
-       if (((LPNMHDR)lParam)->code == TBN_DROPDOWN) {
-               RECT rc;
-               POINT pt;
-               CMenu *pPopup = new CMenu();
-               pPopup->CreatePopupMenu();
-
-               m_toolBar.GetWindowRect(&rc);
-               pt.y = rc.bottom;
-               pt.x = rc.left;
-
-               if ( ((LPNMTOOLBAR)lParam)->iItem == ID_PL_ADD_FILE) {
-                       pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_ADD_DIR, "Directory...");
-                       pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_ADD_DIR_REC, "Directory and subfolders...");
-                       pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_ADD_URL, "URL...");
-                       m_toolBar.GetToolBarCtrl().GetItemRect(3, &rc);
-                       pt.x += rc.left;
-               } else if ( ((LPNMTOOLBAR)lParam)->iItem == ID_PL_REM_FILE) {
-                       pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_REM_ALL, "Clear");
-                       pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_REM_DEAD, "Remove dead entries");
-
-                       m_toolBar.GetToolBarCtrl().GetItemRect(4, &rc);
-                       pt.x += rc.left;
-               } else if ( ((LPNMTOOLBAR)lParam)->iItem == ID_PL_SORT_FILE) {
-                       pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_TITLE, "Sort Files by title");
-                       pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_FILE, "Sort Files by filename");
-                       pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_DUR, "Sort Files by duration");
-                       pPopup->AppendMenu(MF_SEPARATOR,0);
-                       pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_REV, "Reverse Playlist");
-                       pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_RANDOM, "Shuffle Playlist");
-
-                       m_toolBar.GetToolBarCtrl().GetItemRect(8, &rc);
-                       pt.x += rc.left;
-               }
-               pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, this);
-               delete pPopup;
-
-               return FALSE;
-       }
-       return CDialog::OnNotify(wParam, lParam, pResult);
-}
-
-void Playlist::Clear()
-{
-       m_FileList.DeleteAllItems();
-       while (gf_list_count(m_entries)) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, 0);
-               gf_list_rem(m_entries, 0);
-               delete ple;
-       }
-       m_cur_entry = -1;
-}
-
-void Playlist::ClearButPlaying()
-{
-       PLEntry *p;
-       if (m_cur_entry>=0) p = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       if (p) gf_list_rem(m_entries, m_cur_entry);
-
-       Clear();
-       if (p) {
-               gf_list_add(m_entries, p);
-               m_cur_entry = 0;
-       }
-       RefreshList();
-}
-
-void Playlist::UpdateEntry(u32 i)
-{
-       char szText[20];
-       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
-       if (i+1<10) sprintf(szText, "00%d", i+1);
-       else if (i+1<100) sprintf(szText, "0%d", i+1);
-       else sprintf(szText, "%d", i+1);
-       m_FileList.SetItem(i, 0, LVIF_TEXT, szText, 0, 0, 0, 0);
-
-       CString str;
-       if (ple->m_bIsDead) { str = "!! DEAD !! "; str += ple->m_disp_name; }
-       else if (ple->m_bIsPlaying) { str = ">> "; str += ple->m_disp_name; str += " >>"; }
-       else str = ple->m_disp_name;
-       m_FileList.SetItem(i, 1, LVIF_TEXT, str, 0, 0, 0, 0);
-       
-       if (ple->m_duration) {
-               u32 h = (u32) (ple->m_duration / 3600);
-               u32 m = (u32) (ple->m_duration / 60) - h*60;
-               u32 s = (u32) (ple->m_duration) - h*3600 - m*60;
-               sprintf(szText, "%02d:%02d:%02d", h, m, s);
-               m_FileList.SetItem(i, 2, LVIF_TEXT, szText, 0, 0, 0, 0);
-       } else {
-               m_FileList.SetItem(i, 2, LVIF_TEXT, "Unknown", 0, 0, 0, 0);
-       }
-
-}
-
-void Playlist::RefreshList()
-{
-       u32 i, top_idx;
-       char szPath[GF_MAX_PATH];
-
-       top_idx = m_FileList.GetTopIndex();
-       m_FileList.DeleteAllItems();
-
-       for (i=0; i<gf_list_count(m_entries); i++) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
-               m_FileList.InsertItem(i, "");
-               m_FileList.SetItemData(i, (u32) ple);
-
-               UpdateEntry(i);
-               /*in case of sorting*/
-               if (ple->m_bIsPlaying) m_cur_entry = i;
-
-               if (ple->m_bIsSelected) {
-                       m_FileList.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
-                       ple->m_bIsSelected = 0;
-               }
-       }
-       
-       if (m_cur_entry >= (s32)gf_list_count(m_entries)) m_cur_entry = gf_list_count(m_entries);
-       else {
-               s32 last_idx = top_idx + m_FileList.GetCountPerPage();
-               m_FileList.EnsureVisible(top_idx, 0);
-               if (gf_list_count(m_entries)<(u32) last_idx) last_idx = gf_list_count(m_entries);
-               m_FileList.EnsureVisible(last_idx, 1);
-       }
-
-
-       strcpy((char *) szPath, GetApp()->szUserPath);
-       strcat(szPath, "gpac_pl.m3u");
-       Save(szPath, 1);
-}
-
-void Playlist::OnPlAddFile() 
-{
-       Osmo4 *app = GetApp();
-       CString sFiles = app->GetFileFilter();
-       
-       CFileDialog fd(TRUE,NULL,NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST , sFiles);
-       fd.m_ofn.nMaxFile = 25000;
-       fd.m_ofn.lpstrFile = (char *) gf_malloc(sizeof(char) * fd.m_ofn.nMaxFile);
-       fd.m_ofn.lpstrFile[0] = 0;
-
-       if (fd.DoModal() == IDOK) {
-               s32 cur = m_FileList.GetItemCount();
-               POSITION pos = fd.GetStartPosition();
-               while (pos) {
-                       QueueURL(fd.GetNextPathName(pos));
-               }
-       }
-       gf_free(fd.m_ofn.lpstrFile);
-       m_all_dead_entries=-1;
-       RefreshList();
-}
-
-void Playlist::OnClose() 
-{
-       ShowWindow(SW_HIDE);
-}
-
-void Playlist::OnPlRemFile() 
-{
-       if (!m_FileList.GetSelectedCount()) return;
-       POSITION pos = m_FileList.GetFirstSelectedItemPosition();
-       while (pos != NULL) {
-               int nItem = m_FileList.GetNextSelectedItem(pos);
-               PLEntry *ple = (PLEntry *) m_FileList.GetItemData(nItem);
-               gf_list_del_item(m_entries, ple);
-               delete ple;
-       }
-       m_all_dead_entries=-1;
-       RefreshList();
-}
-
-void Playlist::OnSelUp() 
-{
-       s32 i;
-       if (!m_FileList.GetSelectedCount()) return;
-       POSITION pos = m_FileList.GetFirstSelectedItemPosition();
-       int nItem = m_FileList.GetNextSelectedItem(pos);
-       if (nItem==0) return;
-
-       pos = m_FileList.GetFirstSelectedItemPosition();
-       while (pos != NULL) {
-               nItem = m_FileList.GetNextSelectedItem(pos);
-               PLEntry *ple = (PLEntry *) m_FileList.GetItemData(nItem);
-               i = gf_list_del_item(m_entries, ple);
-               assert(i>=1);
-               gf_list_insert(m_entries, ple, i-1);
-               ple->m_bIsSelected = 1;
-       }
-       RefreshList();
-}
-
-void Playlist::OnSelDown() 
-{
-       s32 i, nItem;
-       if (!m_FileList.GetSelectedCount()) return;
-       POSITION pos = m_FileList.GetFirstSelectedItemPosition();
-       while (pos != NULL) nItem = m_FileList.GetNextSelectedItem(pos);
-
-       if ((u32) nItem + 1 == gf_list_count(m_entries)) return;
-
-       pos = m_FileList.GetFirstSelectedItemPosition();
-       while (pos != NULL) {
-               nItem = m_FileList.GetNextSelectedItem(pos);
-               PLEntry *ple = (PLEntry *) m_FileList.GetItemData(nItem);
-               i = gf_list_del_item(m_entries, ple);
-               gf_list_insert(m_entries, ple, i+1);
-               ple->m_bIsSelected = 1;
-       }
-       RefreshList();
-}
-
-void Playlist::OnPlRemAll() 
-{
-       Clear();
-       RefreshList();
-       m_cur_entry = -1;
-}
-
-void Playlist::OnPlRemDead() 
-{
-       for (u32 i=0; i<gf_list_count(m_entries); i++) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
-               if (!ple->m_bIsDead) continue;
-               gf_list_rem(m_entries, i);
-               i--;
-               delete ple;
-       }
-       m_all_dead_entries=-1;
-       RefreshList();
-}
-
-
-static int CALLBACK LocCbck(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData) 
-{
-       char dir[MAX_PATH];
-       if (uMsg == BFFM_INITIALIZED) {
-               strcpy(dir, szCacheDir);
-               SendMessage(hwnd, BFFM_SETSELECTION, TRUE,(LPARAM) dir);
-       }
-       return 0;
-}
-static Bool pl_enum_dir_item(void *cbck, char *item_name, char *item_path)
-{
-       Osmo4 *gpac = GetApp();
-       Playlist *_this = (Playlist *)cbck;
-
-       if (gf_term_is_supported_url(gpac->m_term, item_name, 0, 1)) {
-               _this->QueueURL(item_path);
-       }
-       return 0;
-}
-
-static Bool pl_enum_dir_dirs(void *cbck, char *item_name, char *item_path)
-{
-       gf_enum_directory(item_path, 0, pl_enum_dir_item, cbck, NULL);
-       gf_enum_directory(item_path, 1, pl_enum_dir_dirs, cbck, NULL);
-       return 0;
-}
-
-
-void Playlist::AddDir(Bool do_recurse) 
-{
-       BROWSEINFO brw;
-       LPMALLOC pMalloc;
-       LPITEMIDLIST ret;
-       char dir[MAX_PATH];
-
-       Bool res = 0;
-       if (NOERROR == ::SHGetMalloc(&pMalloc) ) {
-               memset(&brw, 0, sizeof(BROWSEINFO));
-               brw.hwndOwner = this->GetSafeHwnd();
-               brw.pszDisplayName = dir;
-               brw.lpszTitle = "Select Directory...";
-               brw.ulFlags = 0L;
-               brw.lpfn = LocCbck;
-
-               ret = SHBrowseForFolder(&brw);
-               if (ret != NULL) {
-                       if (::SHGetPathFromIDList(ret, dir)) res = 1;
-                       pMalloc->Free(ret);
-               }
-               pMalloc->Release();
-       }
-       if (!res) return;
-       strcpy(szCacheDir, dir);
-
-       gf_enum_directory(dir, 0, pl_enum_dir_item, this, NULL);
-       if (do_recurse) gf_enum_directory(dir, 1, pl_enum_dir_dirs, this, NULL);
-       m_all_dead_entries=-1;
-       RefreshList();
-}
-void Playlist::OnPlAddDir() 
-{
-       AddDir(0);
-}
-void Playlist::OnPlAddDirRec() 
-{
-       AddDir(1);
-}
-
-void Playlist::OnPlAddUrl() 
-{
-       COpenUrl url;
-       if (url.DoModal() != IDOK) return;
-       PLEntry *ple = new PLEntry(url.m_url);
-       gf_list_add(m_entries, ple);
-       m_all_dead_entries=-1;
-       RefreshList();
-}
-
-void Playlist::OnPlSave() 
-{
-       Bool save_m3u;
-       char szPath[GF_MAX_PATH];
-       if (!gf_list_count(m_entries)) return;
-       CFileDialog fd(FALSE,NULL,NULL, OFN_OVERWRITEPROMPT, "M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|");
-       if (fd.DoModal() != IDOK) return;
-
-       strcpy(szPath, fd.GetPathName());
-       strlwr(szPath);
-       save_m3u = (fd.m_ofn.nFilterIndex==1) ? 1 : 0;
-       if (save_m3u) {
-               if (!strstr(szPath, ".m3u")) {
-                       strcpy(szPath, fd.GetPathName());
-                       strcat(szPath, ".m3u");
-               } else {
-                       strcpy(szPath, fd.GetPathName());
-               }
-       } else {
-               if (!strstr(szPath, ".pls")) {
-                       strcpy(szPath, fd.GetPathName());
-                       strcat(szPath, ".pls");
-               } else {
-                       strcpy(szPath, fd.GetPathName());
-               }
-       }
-       Save(szPath, save_m3u);
-}
-
-void Playlist::Save(char *szPath, Bool save_m3u) 
-{
-       FILE *out = gf_f64_open(szPath, "wt");
-       if (!save_m3u) 
-               fprintf(out, "[playlist]\nNumberOfEntries=%d\n", gf_list_count(m_entries));
-
-       for (u32 i=0; i<gf_list_count(m_entries); i++) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
-               if (save_m3u) {
-                       fprintf(out, "%s\n", ple->m_url);
-               } else {
-                       fprintf(out, "File%d=%s\n", i+1, ple->m_url);
-                       fprintf(out, "Title%d=%s\n", i+1, ple->m_disp_name);
-                       fprintf(out, "Length%d=%d\n", i+1, ple->m_duration ? ple->m_duration : -1);
-
-               }
-       }
-       if (!save_m3u) fprintf(out, "Version=2\n");
-
-       fprintf(out, "\n");
-       fclose(out);
-}
-
-void Playlist::OnPlOpen() 
-{
-       CFileDialog fd(TRUE,NULL,NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, "M3U & PLS Playlists|*.m3u;*.pls|M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|");
-       if (fd.DoModal() != IDOK) return;
-
-       Clear();
-       OpenPlayList(fd.GetPathName());
-       m_cur_entry = 0;
-       Play();
-}
-
-void Playlist::OpenPlayList(CString fileName)
-{
-       FILE *pl;
-       PLEntry *ple;
-       Bool load_m3u, go;
-       char szLine[GF_MAX_PATH], *sep;
-       char szPath[GF_MAX_PATH];
-       
-       strcpy(szPath, fileName);
-       sep = strrchr(szPath, '\\');
-       if (sep) sep[1] = 0;
-       else szPath[0] = 0;
-
-       pl = gf_f64_open(fileName, "rt");
-       if (!pl) return;
-       ple = NULL;
-       load_m3u = 1;
-       while (!feof(pl)) {
-               fgets(szLine, GF_MAX_PATH, pl);
-               go = 1;
-               while (go) {
-                       switch (szLine[strlen(szLine)-1]) {
-                       case '\n':
-                       case '\r':
-                       case ' ':
-                               szLine[strlen(szLine)-1] = 0;
-                               break;
-                       default:
-                               go = 0;
-                               break;
-                       }
-               }
-               if (!strlen(szLine)) continue;
-               if (!stricmp(szLine, "[playlist]")) {
-                       load_m3u = 0;
-               } else if (load_m3u) {
-                       ple = new PLEntry(szLine, szPath);
-                       gf_list_add(m_entries, ple);
-               } else if (!strnicmp(szLine, "file", 4)) {
-                       char *st = strchr(szLine, '=');
-                       if (!st) ple = NULL;
-                       else {
-                               ple = new PLEntry(st + 1, szPath);
-                               gf_list_add(m_entries, ple);
-                       }
-               } else if (ple && !strnicmp(szLine, "Length", 6)) {
-                       char *st = strchr(szLine, '=');
-                       s32 d = atoi(st + 1);
-                       if (d>0) ple->m_duration = d;
-               } else if (ple && !strnicmp(szLine, "Title", 5)) {
-                       char *st = strchr(szLine, '=');
-                       gf_free(ple->m_disp_name);
-                       ple->m_disp_name = gf_strdup(st + 6);
-               }
-       }
-       fclose(pl);
-       m_all_dead_entries=-1;
-       m_cur_entry = -1;
-       RefreshList();
-}
-
-
-void Playlist::OnRclickFilelist(NMHDR* pNMHDR, LRESULT* pResult) 
-{
-       if (!m_FileList.GetItemCount()) return;
-
-       CMenu *pPopup = new CMenu();    
-       pPopup->CreatePopupMenu();
-
-       if (m_FileList.GetSelectedCount()==1) {
-               pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_PLAY, "Play");
-               pPopup->AppendMenu(MF_SEPARATOR, 0, "");
-       }
-       pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SEL_REV, "Inverse Selection");
-       if (m_FileList.GetSelectedCount()) pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_REM_FILE, "Remove File(s)");
-       if (m_FileList.GetItemCount()>1) {
-               pPopup->AppendMenu(MF_SEPARATOR, 0, "");
-               pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_TITLE, "Sort By Title");
-               pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_FILE, "Sort By File Name");
-               pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_DUR, "Sort By Duration");
-               pPopup->AppendMenu(MF_SEPARATOR, 0, "");
-               pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_SORT_REV, "Reverse List");
-               pPopup->AppendMenu(MF_STRING | MF_ENABLED, ID_PL_RANDOM, "Randomize");
-       }
-       
-       POINT pt;
-    GetCursorPos(&pt);
-       pPopup->TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this);
-       delete pPopup;
-
-       *pResult = 0;
-}
-
-void Playlist::OnReverseSelection() 
-{
-       u32 i;
-       POSITION pos = m_FileList.GetFirstSelectedItemPosition();
-       while (pos != NULL) {
-               int nItem = m_FileList.GetNextSelectedItem(pos);
-               PLEntry *ple = (PLEntry *) m_FileList.GetItemData(nItem);
-               ple->m_bIsSelected = 1;
-       }
-
-       for (i=0; i<gf_list_count(m_entries); i++) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
-               ple->m_bIsSelected = !ple->m_bIsSelected;
-       }
-       RefreshList();
-}
-
-void Playlist::OnReverseList()
-{
-       u32 count = gf_list_count(m_entries);
-       u32 hcount = count / 2;
-       count--;
-       for (u32 i=0; i<hcount; i++) {
-               PLEntry *ple1 = (PLEntry *) gf_list_get(m_entries, i);
-               PLEntry *ple2 = (PLEntry *) gf_list_get(m_entries, count-i);
-               gf_list_rem(m_entries, i);
-               gf_list_insert(m_entries, ple2, i);
-               gf_list_rem(m_entries, count-i);
-               gf_list_insert(m_entries, ple1, count-i);
-       }
-       RefreshList();
-}
-
-void Playlist::OnRandomize()
-{
-       GF_List *new_entries = gf_list_new();
-
-       gf_rand_init(0);
-
-       while (gf_list_count(m_entries)>1) {
-               u32 pos = gf_rand() % (gf_list_count(m_entries)-1);
-               PLEntry *ple = (PLEntry *)gf_list_get(m_entries, pos);
-               gf_list_rem(m_entries, pos);
-               gf_list_add(new_entries, ple);
-       }
-       PLEntry *ple = (PLEntry *)gf_list_get(m_entries, 0);
-       gf_list_rem(m_entries, 0);
-       gf_list_add(new_entries, ple);
-
-       gf_list_del(m_entries);
-       m_entries = new_entries;
-       m_cur_entry = -1;
-       RefreshList();
-}
-
-void Playlist::Sort(u32 type)
-{
-       u32 i, j, smallest;
-       if (gf_list_count(m_entries)<=1) return;
-
-       for (i=0; i<gf_list_count(m_entries)-1; i++) {
-               smallest = i;
-               for (j=i+1; j<gf_list_count(m_entries); j++) {
-                       PLEntry *ple2 = (PLEntry *) gf_list_get(m_entries, smallest);
-                       PLEntry *ple1 = (PLEntry *) gf_list_get(m_entries, j);
-                       s32 test = 0;
-                       switch (type) {
-                       case 0:
-                test = stricmp(ple1->m_url, ple2->m_url);
-                               break;
-                       case 1:
-                test = stricmp(ple1->m_disp_name, ple2->m_disp_name);
-                               break;
-                       case 2:
-                test = ple1->m_duration - ple2->m_duration;
-                               break;
-                       }
-                       if (test<0) smallest = j;
-               }
-               PLEntry *ple = (PLEntry *)gf_list_get(m_entries, smallest);
-               gf_list_rem(m_entries, smallest);
-               gf_list_insert(m_entries, ple, i);
-       }
-       m_cur_entry = -1;
-       RefreshList();
-}
-
-void Playlist::OnSortFile() { Sort(0); }
-void Playlist::OnSortTitle() { Sort(1); }
-void Playlist::OnSortDuration() { Sort(2); }
-
-
-Bool Playlist::HasValidEntries()
-{
-       u32 nb_dead = 0;
-       if (m_all_dead_entries==-1) {
-               for (u32 i=0; i<gf_list_count(m_entries); i++) {
-                       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
-                       ple->m_bIsPlaying = 0;
-                       if (ple->m_bIsDead) nb_dead ++;
-               }
-               m_all_dead_entries = (nb_dead==gf_list_count(m_entries)) ? 1 : 0;
-       }
-       if (m_all_dead_entries==1) return 0;
-       return 1;
-}
-
-void Playlist::RefreshCurrent()
-{
-       if (m_cur_entry==-1) return;
-       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       if (ple && ple->m_bIsPlaying) {
-               ple->m_bIsPlaying = 0;
-               UpdateEntry(m_cur_entry);
-       }
-}
-
-void Playlist::Play()
-{
-       PLEntry *ple;
-
-       if (!HasValidEntries()) return;
-
-       RefreshCurrent();
-       if (m_cur_entry==-1) m_cur_entry = 0;
-
-       if (m_cur_entry >= (s32)gf_list_count(m_entries)) {
-               if (!GetApp()->m_Loop) return;
-               m_cur_entry = 0;
-       }
-
-       ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       assert(ple);
-       if (ple->m_bIsDead) {
-               m_cur_entry++;
-               Play();
-       } else {
-               char szPLE[20];
-               ple->m_bIsPlaying = 1;
-               UpdateEntry(m_cur_entry);
-               sprintf(szPLE, "%d", m_cur_entry);
-               gf_cfg_set_key(GetApp()->m_user.config, "General", "PLEntry", szPLE);
-               GetApp()->m_pMainWnd->PostMessage(WM_OPENURL);
-       }
-}
-
-void Playlist::OnDblclkFilelist(NMHDR* pNMHDR, LRESULT* pResult) 
-{
-       POSITION pos = m_FileList.GetFirstSelectedItemPosition();
-       RefreshCurrent();
-       m_cur_entry = m_FileList.GetNextSelectedItem(pos);
-       Play();
-       *pResult = 0;
-}
-
-void Playlist::OnPlPlay()
-{
-       POSITION pos = m_FileList.GetFirstSelectedItemPosition();
-
-       RefreshCurrent();
-       m_cur_entry = m_FileList.GetNextSelectedItem(pos);
-       Play();
-}
-
-void Playlist::Truncate()
-{
-       while (m_cur_entry+1 < (s32)gf_list_count(m_entries)) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry+1);
-               gf_list_rem(m_entries, m_cur_entry+1);
-               delete ple;
-       }
-       RefreshList();
-}
-
-
-void Playlist::QueueURL(CString filename)
-{
-       char *ext = (char *) strrchr(filename, '.');
-       if (ext && (!stricmp(ext, ".m3u") || !stricmp(ext, ".pls")) ) {
-               OpenPlayList(filename);
-       } else {
-               PLEntry *ple = new PLEntry(filename);
-               gf_list_add(m_entries, ple);
-       }
-       m_all_dead_entries=-1;
-}
-
-void Playlist::PlayNext()
-{
-       RefreshCurrent();
-       if (1+m_cur_entry < (s32)gf_list_count(m_entries)) {
-               m_cur_entry++;
-               Play();
-       }
-}
-
-void Playlist::PlayPrev()
-{
-       RefreshCurrent();
-       if (m_cur_entry>0) {
-               m_cur_entry--;
-               Play();
-       }
-}
-
-void Playlist::SetDead()
-{
-       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       if (ple) {
-               ple->m_bIsDead = 1;
-               UpdateEntry(m_cur_entry);
-               m_all_dead_entries=-1;
-               if (ple->m_bIsPlaying) PlayNext();
-       }
-}
-void Playlist::SetDuration(u32 duration)
-{
-       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       if (ple) {
-               ple->m_duration = duration;
-               UpdateEntry(m_cur_entry);
-       }
-}
-
-CString Playlist::GetDisplayName()
-{
-       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       if (ple) return CString(ple->m_disp_name);
-       return CString("");
-}
-
-CString Playlist::GetURL()
-{
-       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       if (ple) return CString(ple->m_url);
-       return CString("");
-}
-
diff --git a/applications/osmo4_w32/Playlist.h b/applications/osmo4_w32/Playlist.h
deleted file mode 100644 (file)
index bd899e2..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#if !defined(AFX_PLAYLIST_H__EA74376A_83DF_435E_8484_A15BF5B77A32__INCLUDED_)
-#define AFX_PLAYLIST_H__EA74376A_83DF_435E_8484_A15BF5B77A32__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// Playlist.h : header file
-//
-
-
-class PLEntry 
-{
-public:
-       PLEntry(CString url, char *path = NULL);
-       ~PLEntry();
-
-       char *m_url;
-       char *m_disp_name;
-       u32 m_duration;
-
-       Bool m_bIsSelected;
-       Bool m_bIsDead;
-       Bool m_bIsPlaying;
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Playlist dialog
-
-class Playlist : public CDialog
-{
-// Construction
-public:
-       Playlist();
-       virtual ~Playlist();
-       
-       virtual Bool Create() {
-               /*use desktop window to enable playlist behind player*/
-               return CDialog::Create(IDD_PLAYLIST, GetDesktopWindow());
-       }
-
-       CToolBar    m_toolBar;
-       GF_List *m_entries;
-
-       void Clear();
-       void ClearButPlaying();
-       void RefreshList();
-       void AddDir(Bool do_recurse);
-       void Truncate();
-       void SetDead();
-       void SetDuration(u32 duration);
-       
-       void Play();
-       void PlayNext();
-       void PlayPrev();
-       Bool HasValidEntries();
-       CString GetDisplayName();
-       CString GetURL();
-
-       void OpenPlayList(CString fileName);
-
-       void QueueURL(CString filename);
-       s32 m_cur_entry;
-
-// Dialog Data
-       //{{AFX_DATA(Playlist)
-       enum { IDD = IDD_PLAYLIST};
-       CListCtrl       m_FileList;
-       //}}AFX_DATA
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(Playlist)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);
-       virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-       s32 m_all_dead_entries;
-       void UpdateEntry(u32 idx);
-       void RefreshCurrent();
-       void Sort(u32 type);
-       void Save(char *szPath, Bool save_m3u);
-
-       // Generated message map functions
-       //{{AFX_MSG(Playlist)
-       virtual BOOL OnInitDialog() ;
-       afx_msg void OnSize(UINT nType, int cx, int cy);
-       afx_msg void OnDropFiles(HDROP hDropInfo);
-       afx_msg void OnPlAddFile();
-       afx_msg void OnPlRemFile();
-       afx_msg void OnSelUp();
-       afx_msg void OnSelDown();
-       afx_msg void OnPlSave();
-       afx_msg void OnClose();
-       afx_msg void OnPlRemDead();
-       afx_msg void OnPlRemAll();
-       afx_msg void OnPlAddDir();
-       afx_msg void OnPlAddDirRec();
-       afx_msg void OnPlAddUrl();
-       afx_msg void OnPlOpen();
-       afx_msg void OnReverseSelection();
-       afx_msg void OnReverseList();
-       afx_msg void OnRandomize();
-       afx_msg void OnSortTitle();
-       afx_msg void OnSortFile();
-       afx_msg void OnSortDuration();
-       afx_msg void OnPlPlay();
-       afx_msg void OnRclickFilelist(NMHDR* pNMHDR, LRESULT* pResult);
-       afx_msg void OnDblclkFilelist(NMHDR* pNMHDR, LRESULT* pResult);
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_PLAYLIST_H__EA74376A_83DF_435E_8484_A15BF5B77A32__INCLUDED_)
diff --git a/applications/osmo4_w32/Sliders.cpp b/applications/osmo4_w32/Sliders.cpp
deleted file mode 100644 (file)
index 07574c4..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-// Sliders.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "osmo4.h"
-#include "Sliders.h"
-#include <gpac/options.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// Sliders dialog
-
-
-Sliders::Sliders(CWnd* pParent /*=NULL*/)
-       : CDialog(Sliders::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(Sliders)
-       //}}AFX_DATA_INIT
-
-       m_grabbed = 0;
-}
-
-
-void Sliders::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(Sliders)
-       DDX_Control(pDX, ID_AUDIO_VOL, m_AudioVol);
-       DDX_Control(pDX, ID_SLIDER, m_PosSlider);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(Sliders, CDialog)
-       //{{AFX_MSG_MAP(Sliders)
-       ON_WM_HSCROLL()
-       ON_WM_SIZE()
-       ON_WM_CLOSE()
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// Sliders message handlers
-
-
-void Sliders::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
-{
-       
-       Osmo4 *app = GetApp();
-       if (pScrollBar->GetDlgCtrlID() == ID_SLIDER) {
-               switch (nSBCode) {
-               case TB_LINEUP:
-               case TB_LINEDOWN:
-               case TB_PAGEUP:
-               case TB_PAGEDOWN:
-               case TB_THUMBPOSITION:
-               case TB_THUMBTRACK:
-               case TB_TOP:
-               case TB_BOTTOM:
-                       m_grabbed = 1;
-                       break;
-               case TB_ENDTRACK:
-                       if (!app->can_seek || !app->m_isopen) {
-                               m_PosSlider.SetPos(0);
-                       } else {
-                               u32 seek_to = m_PosSlider.GetPos();
-                               app->PlayFromTime(seek_to);
-                       }
-                       m_grabbed = 0;
-                       break;
-               }
-       }
-       if (pScrollBar->GetDlgCtrlID() == ID_AUDIO_VOL) {
-               u32 vol = m_AudioVol.GetPos();
-               gf_term_set_option(app->m_term, GF_OPT_AUDIO_VOLUME, vol);
-       }
-       CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
-}
-
-void Sliders::OnSize(UINT nType, int cx, int cy) 
-{
-       CDialog::OnSize(nType, cx, cy);
-
-       if (!m_PosSlider.m_hWnd) return;
-       RECT rc, rc2;
-
-       u32 tw = 40;
-       //m_PosSlider.GetClientRect(&rc);
-       //rc.right = rc.left + cx;
-       //m_PosSlider.SetWindowPos(this, rc.left, rc.top, rc.right, rc.bottom, SWP_NOZORDER | SWP_NOMOVE);
-
-       m_PosSlider.GetClientRect(&rc);
-       rc.right = rc.left + cx - tw;
-       m_PosSlider.SetWindowPos(this, rc.left, rc.top, rc.right, rc.bottom, SWP_NOZORDER | SWP_NOMOVE);
-
-       m_AudioVol.GetClientRect(&rc2);
-       rc2.top = rc2.bottom = cy/2;
-       rc2.top -= cy/3;
-       rc2.bottom += cy/3;
-       rc2.left = rc.right;
-       rc2.right = rc.right+tw;
-       m_AudioVol.MoveWindow(&rc2);
-
-}
-
-/*we sure don't want to close this window*/
-void Sliders::OnClose() 
-{
-       u32 i = 0;
-       return;
-}
-
-BOOL Sliders::PreTranslateMessage(MSG* pMsg) 
-{
-       if (pMsg->message == WM_KEYDOWN) {
-               GetApp()->m_pMainWnd->SetFocus();
-               GetApp()->m_pMainWnd->PostMessage(pMsg->message, pMsg->wParam, pMsg->lParam);
-               return TRUE;
-       }
-       return CDialog::PreTranslateMessage(pMsg);
-}
-
-
-BOOL Sliders::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       m_AudioVol.SetRange(0, 100);
-       return TRUE;
-}
-
-void Sliders::SetVolume()
-{
-       m_AudioVol.SetPos(gf_term_get_option(GetApp()->m_term, GF_OPT_AUDIO_VOLUME));
-}
diff --git a/applications/osmo4_w32/Sliders.h b/applications/osmo4_w32/Sliders.h
deleted file mode 100644 (file)
index ce97047..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#if !defined(AFX_SLIDERS_H__3542255E_1376_4FB7_91E7_B4841BB4F173__INCLUDED_)
-#define AFX_SLIDERS_H__3542255E_1376_4FB7_91E7_B4841BB4F173__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// Sliders.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// Sliders dialog
-
-class Sliders : public CDialog
-{
-// Construction
-public:
-       Sliders(CWnd* pParent = NULL);   // standard constructor
-
-       void SetVolume();
-       Bool m_grabbed;
-
-// Dialog Data
-       //{{AFX_DATA(Sliders)
-       enum { IDD = IDD_SLIDERS };
-       CSliderCtrl     m_AudioVol;
-       CSliderCtrl     m_PosSlider;
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(Sliders)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(Sliders)
-       afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
-       afx_msg void OnSize(UINT nType, int cx, int cy);
-       afx_msg void OnClose();
-       virtual BOOL OnInitDialog();
-       virtual BOOL PreTranslateMessage(MSG* pMsg);
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_SLIDERS_H__3542255E_1376_4FB7_91E7_B4841BB4F173__INCLUDED_)
diff --git a/applications/osmo4_w32/StdAfx.cpp b/applications/osmo4_w32/StdAfx.cpp
deleted file mode 100644 (file)
index cdfba52..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-//     GPAC.pch will be the pre-compiled header
-//     stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-
-
diff --git a/applications/osmo4_w32/StdAfx.h b/applications/osmo4_w32/StdAfx.h
deleted file mode 100644 (file)
index 914d5bf..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// stdafx.h : include file for standard system include files,
-//  or project specific include files that are used frequently, but
-//      are changed infrequently
-//
-
-#if !defined(AFX_STDAFX_H__1EEB44C5_1152_4872_8CA7_BD2994085EDC__INCLUDED_)
-#define AFX_STDAFX_H__1EEB44C5_1152_4872_8CA7_BD2994085EDC__INCLUDED_
-
-#ifndef WINVER      
-#define WINVER 0x0501 
-#endif
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#define VC_EXTRALEAN           // Exclude rarely-used stuff from Windows headers
-
-#include <afxwin.h>         // MFC core and standard components
-#include <afxext.h>         // MFC extensions
-#include <afxdtctl.h>          // MFC support for Internet Explorer 4 Common Controls
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h>                    // MFC support for Windows Common Controls
-#endif // _AFX_NO_AFXCMN_SUPPORT
-
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__1EEB44C5_1152_4872_8CA7_BD2994085EDC__INCLUDED_)
diff --git a/applications/osmo4_w32/res/Osmo4.rc2 b/applications/osmo4_w32/res/Osmo4.rc2
deleted file mode 100644 (file)
index b593608..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// Osmo4.RC2 - resources Microsoft Visual C++ does not edit directly
-//
-
-#ifdef APSTUDIO_INVOKED
-       #error this file is not editable by Microsoft Visual C++
-#endif //APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Add manually edited resources here...
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/applications/osmo4_w32/res/error.ico b/applications/osmo4_w32/res/error.ico
deleted file mode 100644 (file)
index 8a2d46c..0000000
Binary files a/applications/osmo4_w32/res/error.ico and /dev/null differ
diff --git a/applications/osmo4_w32/res/maintool.bmp b/applications/osmo4_w32/res/maintool.bmp
deleted file mode 100644 (file)
index 054dde0..0000000
Binary files a/applications/osmo4_w32/res/maintool.bmp and /dev/null differ
diff --git a/applications/osmo4_w32/res/message.ico b/applications/osmo4_w32/res/message.ico
deleted file mode 100644 (file)
index 95f120e..0000000
Binary files a/applications/osmo4_w32/res/message.ico and /dev/null differ
diff --git a/applications/osmo4_w32/res/osmo4.ico b/applications/osmo4_w32/res/osmo4.ico
deleted file mode 100644 (file)
index 36ff667..0000000
Binary files a/applications/osmo4_w32/res/osmo4.ico and /dev/null differ
diff --git a/applications/osmo4_w32/res/pause.ico b/applications/osmo4_w32/res/pause.ico
deleted file mode 100644 (file)
index 7fab353..0000000
Binary files a/applications/osmo4_w32/res/pause.ico and /dev/null differ
diff --git a/applications/osmo4_w32/res/play.ico b/applications/osmo4_w32/res/play.ico
deleted file mode 100644 (file)
index 2c71aa6..0000000
Binary files a/applications/osmo4_w32/res/play.ico and /dev/null differ
diff --git a/applications/osmo4_w32/res/playlist.bmp b/applications/osmo4_w32/res/playlist.bmp
deleted file mode 100644 (file)
index 2235fbf..0000000
Binary files a/applications/osmo4_w32/res/playlist.bmp and /dev/null differ
diff --git a/applications/osmo4_w32/res/stop.ico b/applications/osmo4_w32/res/stop.ico
deleted file mode 100644 (file)
index 52e1a3b..0000000
Binary files a/applications/osmo4_w32/res/stop.ico and /dev/null differ
diff --git a/applications/osmo4_w32/resource.h b/applications/osmo4_w32/resource.h
deleted file mode 100644 (file)
index 9330426..0000000
+++ /dev/null
@@ -1,322 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by Osmo4.rc
-//
-#define IDD_ABOUTBOX                    100
-#define IDR_MAINFRAME                   128
-#define IDR_GPACTYPE                    129
-#define IDD_CONTROL                     132
-#define IDI_PLAY                        141
-#define IDI_STOP                        142
-#define IDI_PAUSE                       143
-#define IDI_MESSAGE                     144
-#define IDI_ERR                         145
-#define IDD_OPTIONS                     152
-#define IDD_OPT_GEN                     154
-#define IDD_OPT_RENDER                  155
-#define IDD_OPT_AUDIO                   157
-#define IDD_OPT_VIDEO                   158
-#define IDD_OPT_HTTP                    159
-#define IDD_OPT_FONT                    161
-#define IDD_OPT_SYSTEMS                 162
-#define IDD_OPT_STREAM                  164
-#define IDD_PROPERTIES                  166
-#define IDD_OPT_DECODER                 167
-#define IDD_OPT_RENDER2D                168
-#define IDD_OPT_RENDER3D                169
-#define IDR_MAINTOOLS                   170
-#define ID_MAINSLIDER                   171
-#define IDD_SLIDERS                     173
-#define IDD_NAVBAR                      176
-#define IDD_PLAYLIST                    177
-#define IDR_PLAYLIST                    178
-#define IDD_OPT_FILETYPES               179
-#define IDR_MENUPL                      182
-#define IDD_PASSWD                      188
-#define IDC_FILES_MIMES                 1000
-#define IDC_FILES_PLUG                  1001
-#define ID_AUDIO_VOL                    1002
-#define IDC_TXT_SITE                    1003
-#define IDC_EDIT_USER                   1004
-#define IDC_EDIT_PASSWORD               1005
-#define IDC_PLAY                        1006
-#define IDC_STOP                        1007
-#define IDC_COMBOURL                    1008
-#define IDC_BROWSE                      1009
-#define IDC_BUTGO                       1010
-#define IDC_SPIN_OPT                    1011
-#define IDC_OPT_SET_NAME                1012
-#define IDC_LANG                        1013
-#define IDC_LOOP                        1014
-#define IDC_AUTOSTART                   1015
-#define IDC_FILEASSOC                   1016
-#define IDC_NO_CONSOLE                  1017
-#define IDC_BIFS_RATE                   1018
-#define IDC_DEC_THREAD                  1019
-#define IDC_DIRECTRENDER                1020
-#define IDC_HWMEMORY                    1021
-#define IDC_BIFSDROP                    1023
-#define IDC_SPIN_AUDIO                  1024
-#define IDC_EDIT_AUDIO                  1025
-#define IDC_FORCE_AUDIO                 1026
-#define IDC_SPIN_FPS                    1027
-#define IDC_AUDIO_FPS                   1028
-#define IDC_AUDIO_MULTICH               1029
-#define IDC_GD_LIST                     1031
-#define IDC_FAST_RENDER                 1032
-#define IDC_FORCE_DURATION              1033
-#define IDC_YUV                         1034
-#define IDC_AUDIO_RESYNC                1035
-#define IDC_AUDIO_NOTIFS                1036
-#define IDC_STOPATEND                   1037
-#define IDC_CLEAN_CACHE                 1038
-#define IDC_RESTART_CACHE               1039
-#define IDC_NOTIFY_PROG                 1040
-#define IDC_BROWSE_CACHE                1041
-#define IDC_LOOKFORSUB                  1042
-#define IDD_OPT_MCACHE                  1043
-#define IDC_DRIVER_LIST                 1044
-#define IDC_AA_LIST                     1045
-#define IDC_ZOOM_SCALABLE               1046
-#define IDD_OPENFILE                    1047
-#define IDC_SINGLE_INSTANCE             1048
-#define IDC_VIDEO_LIST                  1049
-#define IDC_FONT_LIST                   1050
-#define IDC_BROWSE_FONT                 1051
-#define IDC_USE_FONT                    1052
-#define IDC_SAVEOPT                     1053
-#define IDC_PORT                        1054
-#define IDC_RTSP                        1055
-#define IDC_TIMEOUT                     1056
-#define IDC_BUFFER                      1057
-#define IDC_REBUFFER_LEN                1058
-#define IDC_REBUFFER                    1059
-#define IDC_ODTREE                      1060
-#define IDC_VIEWSG                      1061
-#define IDC_FORCE_SIZE                  1062
-#define IDC_USE_RENDER3D                1063
-#define IDC_ODINFO                      1064
-#define IDC_WORLD                       1065
-#define IDC_GOGPAC                      1066
-#define IDC_GOOSMO4                     1067
-#define IDC_DUMP_XMT                    1068
-#define IDC_OBJECT_TIME                 1069
-#define IDC_FORMAT_YUV                  1070
-#define IDC_DRAW_BOUNDS                 1071
-#define IDC_REORDER                     1072
-#define IDC_TEXTURE_MODE                1073
-#define IDC_SWITCH_RES                  1074
-#define IDC_AUDEC_LIST                  1075
-#define IDC_VIDEC_LIST                  1076
-#define IDC_ASSOCIATE                   1077
-#define IDC_RASTER_OUTLINE              1078
-#define IDC_EMUL_POW2                   1079
-#define IDC_DISABLE_POLY_AA             1080
-#define IDC_WIRE_NONE                   1081
-#define IDC_WIRE_ONLY                   1082
-#define IDC_WIRE_BOTH                   1083
-#define IDC_DISABLE_TX_RECT             1084
-#define IDC_BITMAP_USE_PIXEL            1085
-#define IDC_TEXTURE_TEXT                1086
-#define IDC_SLIDER                      1087
-#define ID_SLIDER                       1088
-#define IDC_SELECT                      1089
-#define IDC_NO_BACKCULL                 1090
-#define IDC_FILES_EXT                   1091
-#define IDC_VIEWSEL                     1094
-#define IDC_ADDRESS                     1096
-#define IDC_DUMTXT                      1097
-#define IDC_FILELIST                    1109
-#define IDC_BROWSE_MCACHE               1110
-#define IDC_MCACHE_OVERWRITE            1111
-#define IDC_MCACHE_USENAME              1112
-#define IDC_BASEPRES                    1113
-#define ID_FILE_EXIT                    1114
-#define ID_H_ABOUT                      1115
-#define ID_PLAYLIST_LOOP                1116
-#define ID_FILEOPEN                     1117
-#define ID_VIEW_CONTROL                 1118
-#define ID_VIEW_ORIGINAL                1119
-#define ID_VIEW_FULLSCREEN              1120
-#define ID_AR_KEEP                      1121
-#define IDC_DRAW_NORMALS                1122
-#define IDC_BACK_CULL                   1123
-#define IDC_DRAW_MODE                   1124
-#define ID_SHORTCUTS                    1125
-#define ID_FILE_RESTART                 1126
-#define ID_OPT_QUALITY                  1127
-#define ID_FILE_PROP                    1128
-#define ID_FILE_STEP                    1129
-#define IDD_CONFIGURE                   1130
-#define ID_VIEW_SCALABLE                1131
-#define ID_OPEN_URL                     1132
-#define ID_FILE_RELOAD                  1133
-#define ID_FILE_PLAY                    1134
-#define ID_NAVIGATE_NONE                1135
-#define ID_NAVIGATE_WALK                1136
-#define ID_NAVIGATE_FLY                 1137
-#define ID_NAVIGATE_EXAM                1138
-#define ID_NAVIGATE_PAN                 1139
-#define ID_NAVIGATE_SLIDE               1140
-#define ID_NAVIGATE_GAME                1141
-#define ID_AR_FILL                      1142
-#define ID_AR_43                        1143
-#define ID_AR_169                       1144
-#define ID_FILE_MIGRATE                                        1145
-#define ID_NAV_RESET                    1151
-#define ID_FILE_STOP                    1152
-#define ID_FILE_PREV                    1155
-#define ID_FILE_NEXT                    1156
-#define ID_FILE_PROPS                   1157
-#define ID_SWITCH_RENDER                1158
-#define ID_RELOAD_TERMINAL              1159
-#define ID_VIEW_PLAYLIST                1160
-#define ID_NAVIGATE_ORBIT               1161
-#define ID_COLLIDE_NONE                 1162
-#define ID_COLLIDE_REG                  1163
-#define ID_COLLIDE_DISP                 1164
-#define ID_GRAVITY                      1165
-#define ID_HEADLIGHT                    1166
-#define ID_NAV_INFO                     1167
-#define ID_NAV_PREV                     1168
-#define ID_NAV_NEXT                     1169
-#define ID_CLEAR_NAV                    1170
-#define ID_TIMER                        1171
-#define ID_FPS                          1172
-#define ID_VIEWPORT_EMPTY               1173
-#define ID_PL_REM_ALL                   1174
-#define ID_PL_REM_DEAD                  1175
-#define ID_PL_ADD_DIR_REC               1176
-#define ID_PL_ADD_FILE                  1177
-#define ID_PL_REM_FILE                  1178
-#define ID_PL_OPEN                      1179
-#define ID_PL_SAVE                      1180
-#define ID_PL_UP                        1181
-#define ID_PL_DOWN                      1182
-#define ID_VIEW_PL                      1183
-#define ID_PL_ADD_DIR                   1184
-#define ID_PL_ADD_URL                   1185
-#define ID_PL_PLAY                      1186
-#define ID_PL_SEL_REV                   1187
-#define ID_PL_SORT_TITLE                1188
-#define ID_PL_SORT_FILE                 1189
-#define ID_PL_SORT_DUR                  1190
-#define ID_PL_SORT_REV                  1191
-#define ID_PL_RANDOM                    1192
-#define ID_ADD_SUBTITLE                 1193
-#define ID_NAVIGATE_VR                  1194
-#define ID_REC_ENABLE                   1195
-#define ID_REC_STOP                     1196
-#define ID_REC_ABORT                    1197
-#define ID_AUDIO_EMPTY                  1198
-#define ID_VIDEO_EMPTY                  1199
-#define ID_SUBS_EMPTY                   1200
-#define ID_VIEW_CPU                     1201
-#define IDC_SAX_PROGRESSIVE             1202
-#define IDC_SAX_DELAY                   1203
-#define IDC_HTTP_PROXY                  1204
-#define IDC_HTTP_USE_PROXY              1205
-#define IDC_LOG_LEVEL                   1210
-#define IDC_TOOL_CORE                   1211
-#define IDC_TOOL_CODING                 1212
-#define IDC_TOOL_CONTAINER              1213
-#define IDC_TOOL_NET                    1214
-#define IDC_TOOL_RTP                    1215
-#define IDC_TOOL_AUTHOR                 1216
-#define IDC_TOOL_CODEC                  1217
-#define IDC_TOOL_PARSER                 1218
-#define IDC_TOOL_MEDIA                  1219
-#define IDC_TOOL_SCENE                  1220
-#define IDC_TOOL_SCRIPT                 1221
-#define IDC_TOOL_COMPOSE                1222
-#define IDC_TOOL_RENDER                 1223
-#define IDC_TOOL_MMIO                   1224
-#define IDC_TOOL_SYNC                   1225
-#define IDD_OPT_LOGS                    1226
-#define ID_VP_0                         1300
-#define ID_VP_1                         1301
-#define ID_VP_2                         1302
-#define ID_VP_3                         1303
-#define ID_VP_4                         1304
-#define ID_VP_5                         1305
-#define ID_VP_6                         1306
-#define ID_VP_7                         1307
-#define ID_VP_8                         1308
-#define ID_VP_9                         1309
-#define ID_VP_10                        1310
-#define ID_VP_11                        1311
-#define ID_VP_12                        1312
-#define ID_VP_13                        1313
-#define ID_VP_14                        1314
-#define ID_VP_15                        1315
-#define ID_VP_16                        1316
-#define ID_VP_17                        1317
-#define ID_VP_18                        1318
-#define ID_VP_19                        1319
-#define ID_NAV_PREV_0                   1320
-#define ID_NAV_PREV_1                   1321
-#define ID_NAV_PREV_2                   1322
-#define ID_NAV_PREV_3                   1323
-#define ID_NAV_PREV_4                   1324
-#define ID_NAV_PREV_5                   1325
-#define ID_NAV_PREV_6                   1326
-#define ID_NAV_PREV_7                   1327
-#define ID_NAV_PREV_8                   1328
-#define ID_NAV_PREV_9                   1329
-#define ID_NAV_NEXT_0                   1330
-#define ID_NAV_NEXT_1                   1331
-#define ID_NAV_NEXT_2                   1332
-#define ID_NAV_NEXT_3                   1333
-#define ID_NAV_NEXT_4                   1334
-#define ID_NAV_NEXT_5                   1335
-#define ID_NAV_NEXT_6                   1336
-#define ID_NAV_NEXT_7                   1337
-#define ID_NAV_NEXT_8                   1338
-#define ID_NAV_NEXT_9                   1339
-#define ID_SELOBJ_0                     1340
-#define ID_SELOBJ_1                     1341
-#define ID_SELOBJ_2                     1342
-#define ID_SELOBJ_3                     1343
-#define ID_SELOBJ_4                     1344
-#define ID_SELOBJ_5                     1345
-#define ID_SELOBJ_6                     1346
-#define ID_SELOBJ_7                     1347
-#define ID_SELOBJ_8                     1348
-#define ID_SELOBJ_9                     1349
-#define ID_SELOBJ_10                    1350
-#define ID_SELOBJ_11                    1351
-#define ID_SELOBJ_12                    1352
-#define ID_SELOBJ_13                    1353
-#define ID_SELOBJ_14                    1354
-#define ID_SELOBJ_15                    1355
-#define ID_SELOBJ_16                    1356
-#define ID_SELOBJ_17                    1357
-#define ID_SELOBJ_18                    1358
-#define ID_SELOBJ_19                    1359
-#define ID_SELOBJ_20                    1360
-#define ID_SELOBJ_21                    1361
-#define ID_SELOBJ_22                    1362
-#define ID_SELOBJ_23                    1363
-#define ID_SELOBJ_24                    1364
-#define ID_SELOBJ_25                    1365
-#define ID_SELOBJ_26                    1366
-#define ID_SELOBJ_27                    1367
-#define ID_SELOBJ_28                    1368
-#define ID_SELOBJ_29                    1369
-#define ID_SETCHAP_FIRST                2000
-#define ID_SETCHAP_LAST                 2200
-#define ID_FILE_COPY                    32961
-#define ID_FILE_PASTE                   32962
-#define ID_CONFIG_RELOAD                32963
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        189
-#define _APS_NEXT_COMMAND_VALUE         32964
-#define _APS_NEXT_CONTROL_VALUE         1131
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
diff --git a/applications/osmo4_wce/MainFrm.cpp b/applications/osmo4_wce/MainFrm.cpp
deleted file mode 100644 (file)
index 9533161..0000000
+++ /dev/null
@@ -1,642 +0,0 @@
-// MainFrm.cpp : implementation of the CMainFrame class
-//
-
-#ifdef _DEBUG
-#include "stdafx.h"
-#else
-#include "stdafx.h"
-#undef _DEBUG
-#endif
-
-#include "Osmo4.h"
-
-#include <gpac/options.h>
-#include <gpac/network.h>
-
-#include "MainFrm.h"
-#include <gx.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-
-
-CChildView::CChildView()
-{
-}
-
-CChildView::~CChildView()
-{
-       /*since the wndproc is overwritten by the terminal, we detach the handle otherwise we get a nice assertion
-       failure from windows*/
-       HWND hWnd = Detach();
-       ::PostMessage(hWnd, WM_QUIT, 0, 0);
-}
-
-
-BEGIN_MESSAGE_MAP(CChildView,CWnd )
-       //{{AFX_MSG_MAP(CChildView)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CChildView message handlers
-
-BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs) 
-{
-       if (!CWnd::PreCreateWindow(cs))
-               return FALSE;
-
-       cs.style &= ~WS_BORDER;
-       cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, 
-               NULL, HBRUSH(COLOR_WINDOW+1), NULL);
-
-       return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame
-
-IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)
-
-BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
-       //{{AFX_MSG_MAP(CMainFrame)
-       ON_WM_CREATE()
-       ON_WM_SETFOCUS()
-       ON_COMMAND(ID_APP_EXIT, OnAppExit)
-       ON_MESSAGE(WM_OPENURL, Open)
-       ON_MESSAGE(WM_SETTINGCHANGE, OnSIPChange)
-       ON_MESSAGE(WM_SETSIZE,OnSetSize)
-       ON_MESSAGE(WM_NAVIGATE,OnNavigate)
-       ON_WM_SIZE()
-       ON_COMMAND(ID_FILE_STEP, OnFileStep)
-       ON_UPDATE_COMMAND_UI(ID_FILE_STEP, OnUpdateFileStep)
-       ON_COMMAND(ID_FILE_PAUSE, OnFilePause)
-       ON_UPDATE_COMMAND_UI(ID_FILE_PAUSE, OnUpdateFilePause)
-       ON_COMMAND(ID_FILE_STOP, OnFileStop)
-       ON_UPDATE_COMMAND_UI(ID_FILE_STOP, OnUpdateFileStop)
-       ON_COMMAND(ID_VIEW_FULLSCREEN, OnViewFullscreen)
-       ON_UPDATE_COMMAND_UI(ID_VIEW_FULLSCREEN, OnUpdateViewFullscreen)
-       ON_WM_CLOSE()
-       ON_COMMAND(ID_VIEW_FIT, OnViewFit)
-       ON_UPDATE_COMMAND_UI(ID_VIEW_FIT, OnUpdateViewFit)
-       ON_COMMAND(ID_VIEW_AR_ORIG, OnViewArOrig)
-       ON_COMMAND(ID_VIEW_AR_FILL, OnViewArFill)
-       ON_COMMAND(ID_VIEW_AR_43, OnViewAr43)
-       ON_COMMAND(ID_VIEW_AR_169, OnViewAr169)
-       ON_COMMAND(ID_NAV_NONE, OnNavNone)
-       ON_COMMAND(ID_NAV_SLIDE, OnNavSlide)
-       ON_COMMAND(ID_NAV_RESET, OnNaveReset)
-       ON_COMMAND_RANGE(ID_NAV_NONE, ID_NAV_EXAMINE, OnSetNavigation)
-       ON_WM_KEYDOWN()
-       ON_WM_KEYUP()
-       ON_COMMAND(ID_VIEW_TIMING, OnViewTiming)
-       ON_UPDATE_COMMAND_UI(ID_VIEW_TIMING, OnUpdateViewTiming)
-       ON_WM_INITMENUPOPUP()
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame construction/destruction
-
-CMainFrame::CMainFrame()
-{
-       GXOpenInput();
-       m_view_timing = 0;
-       m_restore_fs = 0;
-}
-
-CMainFrame::~CMainFrame()
-{
-       GXCloseInput();
-}
-
-void CMainFrame::OnSetFocus(CWnd* pOldWnd)
-{
-       if (m_restore_fs) {
-               m_restore_fs = 0;
-               GetApp()->ShowTaskBar(0);
-               OnViewFullscreen();
-       }
-}
-
-int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
-       COsmo4 *app = GetApp();
-
-       if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
-               return -1;
-
-       // create a view to occupy the client area of the frame
-       if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW | WS_BORDER,
-               CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
-       {
-               TRACE0("Failed to create view window\n");
-               return -1;
-       }
-       m_wndView.ShowWindow(SW_HIDE);
-
-       
-       if (!m_dumbWnd.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW | WS_BORDER,
-               CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
-       {
-               TRACE0("Failed to create dumb window\n");
-               return -1;
-       }
-       m_dumbWnd.SetWindowPos(this, 0, 0, app->m_screen_width, app->m_screen_height-app->m_menu_height, 0L);
-       m_dumbWnd.ShowWindow(SW_HIDE);
-
-       if (!m_progBar.Create(IDD_CONTROL , this) ) {
-               TRACE0("Failed to create status bar\n");
-               return -1;      // fail to create
-       }
-       m_progBar.UpdateWindow();
-       m_progBar.SetWindowPos(this, 0, 0, app->m_screen_width, app->m_menu_height, 0L);
-       m_progBar.ShowWindow(SW_SHOWNORMAL);
-       
-
-//     m_wndCommandBar.m_bShowSharedNewButton = FALSE;
-
-       if (!m_wndCommandBar.Create(this) 
-                       || !m_wndCommandBar.InsertMenuBar(IDR_MENU)
-                       || !m_wndCommandBar.AddAdornments()
-                       || !m_wndCommandBar.LoadBitmap(IDR_MAINFRAME) 
-               )
-       {
-               TRACE0("Failed to create CommandBar\n");
-               return -1;      // fail to create
-       }
-
-       CToolBarCtrl & toolBar = m_wndCommandBar.GetToolBarCtrl();
-       TBBUTTON tb;
-       memset(&tb, 0, sizeof(tb));
-    tb.idCommand = ID_OPEN_FILE; tb.iBitmap = 0; tb.fsStyle = TBSTYLE_BUTTON; toolBar.AddButtons(1, &tb);
-    tb.idCommand = 0; tb.iBitmap = 0; tb.fsStyle = TBSTYLE_SEP; toolBar.AddButtons(1, &tb);
-    tb.idCommand = ID_FILE_PAUSE; tb.iBitmap = 1; tb.fsStyle = TBSTYLE_BUTTON; toolBar.AddButtons(1, &tb);
-    tb.idCommand = ID_FILE_STEP; tb.iBitmap = 2; tb.fsStyle = TBSTYLE_BUTTON; toolBar.AddButtons(1, &tb);
-    tb.idCommand = ID_FILE_STOP; tb.iBitmap = 3; tb.fsStyle = TBSTYLE_BUTTON; toolBar.AddButtons(1, &tb);
-    tb.idCommand = 0; tb.iBitmap = 0; tb.fsStyle = TBSTYLE_SEP; toolBar.AddButtons(1, &tb);
-       
-       SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), TRUE);
-       SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE);
-       SetWindowPos(NULL, 0, 0, app->m_screen_width, app->m_screen_height, 0L);
-
-       SetWindowText(_T("Osmo4"));     
-       return 0;
-}
-
-void CMainFrame::SetPauseButton(Bool force_play_button)
-{
-       CToolBarCtrl & toolBar = m_wndCommandBar.GetToolBarCtrl();
-       TBBUTTON tb;
-       memset(&tb, 0, sizeof(tb));
-    tb.idCommand = ID_FILE_PAUSE; tb.fsStyle = TBSTYLE_BUTTON;
-       
-       if (force_play_button || GetApp()->m_stopped || gf_term_get_option(GetApp()->m_term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED) {
-               tb.iBitmap = 4;
-       } else {
-               tb.iBitmap = 1;
-       }
-       toolBar.DeleteButton(5);
-       toolBar.InsertButton(5, &tb);
-}
-
-
-BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
-{
-       if( !CFrameWnd::PreCreateWindow(cs) )
-               return FALSE;
-       // TODO: Modify the Window class or styles here by modifying
-       //  the CREATESTRUCT cs
-
-
-       cs.lpszClass = AfxRegisterWndClass(0);
-       return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame diagnostics
-
-/*
-#ifdef _DEBUG
-void CMainFrame::AssertValid() const
-{
-       CFrameWnd::AssertValid();
-}
-
-void CMainFrame::Dump(CDumpContext& dc) const
-{
-       CFrameWnd::Dump(dc);
-}
-
-#endif //_DEBUG
-*/
-
-/////////////////////////////////////////////////////////////////////////////
-// CMainFrame message handlers
-BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
-{
-       // let the view have first crack at the command
-       if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
-               return TRUE;
-
-       // otherwise, do default handling
-       return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
-}
-
-#define PROGRESS_TIMER 20
-#define PROGRESS_REFRESH_MS            500
-
-void CALLBACK EXPORT ProgressTimer(HWND , UINT , UINT nID , DWORD )
-{
-       if (nID != PROGRESS_TIMER) return;
-       ((CMainFrame *) GetApp()->m_pMainWnd)->UpdateTime();
-}
-
-void CMainFrame::UpdateTime()
-{
-       u32 now;
-
-       COsmo4 *app = GetApp();
-       if (!app->m_open || app->m_stopped) return;
-       now = gf_term_get_time_in_ms(app->m_term);
-       if (!now) return;
-
-       if (app->m_can_seek && (now>=app->m_duration + 100)) {
-               if (gf_term_get_option(app->m_term, GF_OPT_IS_FINISHED)) {
-                       if (app->m_Loop && m_full_screen) {
-                               gf_term_play_from_time(app->m_term, 0, 0);
-                       } else {
-                               OnFileStop();
-                               if (app->m_Loop) OnFilePause();
-                       }
-                       return;
-               }
-       } 
-
-       if (!m_full_screen) m_progBar.SetPosition(now);
-}
-
-void CMainFrame::CloseURL()
-{
-       COsmo4 *app = GetApp();
-       if (!app->m_open) return;
-       if (m_view_timing) KillTimer(PROGRESS_TIMER);
-       gf_term_disconnect(app->m_term);
-       app->m_open = 0;
-       app->m_can_seek = 0;
-       app->m_duration = (u32) -1;
-       m_progBar.m_prev_time = 0;
-       m_progBar.SetPosition(0);
-}
-
-void CMainFrame::OnAppExit() 
-{
-       CloseURL();
-       PostMessage(WM_QUIT);
-}
-
-void CMainFrame::OnSize(UINT nType, int cx, int cy) 
-{
-       COsmo4 *app = GetApp();
-       u32 disp_w, disp_h, c_w, c_h, x, y;
-
-       if (m_full_screen) return;
-
-       disp_w = app->m_screen_width;
-       disp_h = app->m_screen_height;
-       CFrameWnd::OnSize(nType, disp_w, disp_h);
-
-       x = y = 0;
-       disp_h -= app->m_menu_height;
-
-       if (m_view_timing) {
-               disp_h -= app->m_menu_height;
-               y = app->m_menu_height;
-               m_progBar.SetWindowPos(this, 0, 0, app->m_screen_width, app->m_menu_height, 0L);
-               m_progBar.ShowWindow(SW_SHOWNORMAL);
-       } else {
-               m_progBar.ShowWindow(SW_HIDE);
-       }
-       m_dumbWnd.SetWindowPos(this, 0, y, disp_w, disp_h, 0L);
-       m_dumbWnd.ShowWindow(SW_SHOW);
-
-       if (m_view_timing)
-               SetTimer(PROGRESS_TIMER, PROGRESS_REFRESH_MS, ProgressTimer);
-
-       if (!app->m_scene_width || !app->m_scene_height) {
-               m_wndView.SetWindowPos(this, 0, y, disp_w, disp_h, SWP_SHOWWINDOW);
-               gf_term_set_size(app->m_term, disp_w, disp_h);
-               return;
-       }
-
-       if (!app->m_fit_screen && (app->m_scene_width < disp_w) && (app->m_scene_height < disp_h)) {
-               c_w = app->m_scene_width;
-               c_h = app->m_scene_height;
-               x = (disp_w - c_w) / 2;
-               y = (disp_h - c_h) / 2;
-       } else {
-               c_w = disp_w;
-               c_h = disp_h;
-       }
-       m_wndView.SetWindowPos(this, x, y, c_w, c_h, SWP_SHOWWINDOW | SWP_NOZORDER);
-       gf_term_set_size(app->m_term, c_w, c_h);
-}
-
-
-void CMainFrame::OnViewFullscreen() 
-{
-       COsmo4 *app = GetApp();
-       if (!app->m_open) return;
-       u32 disp_w = app->m_screen_width;
-       u32 disp_h = app->m_screen_height;
-       
-       Bool is_full_screen = !m_full_screen;
-
-       /*prevent resize messages*/
-       m_full_screen = 1;
-
-       HWND hWnd = GetSafeHwnd();
-       ::SetForegroundWindow(hWnd);
-       ::CommandBar_Show(m_wndCommandBar.GetSafeHwnd(), is_full_screen ? FALSE : TRUE);
-       SHFullScreen(hWnd, SHFS_HIDESTARTICON | SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);
-
-       if (is_full_screen) {
-               m_dumbWnd.ShowWindow(SW_HIDE);
-
-               ::MoveWindow(m_hWnd, 0, 0, disp_w, disp_h, 0);
-               m_wndView.GetWindowRect(&m_view_rc);
-               m_wndView.SetWindowPos(this, 0, 0, disp_w, disp_h, SWP_NOZORDER);
-               gf_term_set_option(app->m_term, GF_OPT_FULLSCREEN, is_full_screen);
-               m_full_screen = 1;
-       } else {
-               gf_term_set_option(app->m_term, GF_OPT_FULLSCREEN, is_full_screen);
-               m_full_screen = 0;
-               OnSetSize(0,0);
-               m_dumbWnd.ShowWindow(SW_SHOW);
-               gf_term_set_option(app->m_term, GF_OPT_REFRESH, 0);
-       }
-}
-
-
-void CMainFrame::OnUpdateViewFullscreen(CCmdUI* pCmdUI) 
-{
-       pCmdUI->Enable(GetApp()->m_open ? TRUE : FALSE);
-}
-
-LONG CMainFrame::OnSetSize(WPARAM wParam, LPARAM lParam)
-{
-       RECT rc;
-       if (m_full_screen) return 0;
-       GetWindowRect(&rc);
-       SetWindowPos(NULL, 0, 0, rc.right-rc.left, rc.bottom-rc.top, SWP_NOZORDER | SWP_NOMOVE);
-       return 1;       
-}
-
-LONG CMainFrame::Open(WPARAM wParam, LPARAM lParam)
-{
-       COsmo4 *app = GetApp();
-       CloseURL();
-       char filename[5000];
-       CE_WideToChar((u16 *) (LPCTSTR) app->m_filename, filename);
-       app->m_stopped = 0;
-       
-       if (app->m_reconnect_time) {
-               gf_term_connect_from_time(app->m_term, filename, app->m_reconnect_time, 0);
-               app->m_reconnect_time = 0;
-       } else {
-               gf_term_connect(app->m_term, filename);
-       }
-       app->SetBacklightState(1);
-       return 1;       
-}
-
-
-
-
-LONG CMainFrame::OnNavigate(WPARAM /*wParam*/, LPARAM /*lParam*/)
-{
-       COsmo4 *app = GetApp();
-       char to_url[MAX_PATH];
-       CE_WideToChar((u16 *) (LPCTSTR) app->m_navigate_url, to_url);
-
-       if (gf_term_is_supported_url(app->m_term, to_url, 1, app->m_no_mime_fetch)) {
-               char fileName[MAX_PATH];
-               TCHAR w_to_url[MAX_PATH];
-               CE_WideToChar((u16 *) (LPCTSTR) app->m_filename, fileName);
-               char *str = gf_url_concatenate(fileName, to_url);
-               if (!str) str = gf_strdup(to_url);
-               CE_CharToWide(str, (u16 *)w_to_url);
-               gf_free(str);
-               app->m_filename = w_to_url;
-               Open(0, 0);
-       } else {
-               SHELLEXECUTEINFO info;
-               console_message = app->m_navigate_url;
-               console_err = GF_OK;
-               PostMessage(WM_CONSOLEMSG);
-
-               
-               if (m_full_screen) {
-                       OnViewFullscreen();
-                       app->ShowTaskBar(1);
-                       m_restore_fs = 1;
-               }
-       
-               memset(&info, 0, sizeof(SHELLEXECUTEINFO));
-               info.cbSize = sizeof(SHELLEXECUTEINFO);
-               info.lpVerb = L"open";
-               info.fMask = SEE_MASK_NOCLOSEPROCESS;
-               info.lpFile = L"iexplore";
-               info.lpParameters = (LPCTSTR) app->m_navigate_url;
-               info.nShow = SW_SHOWNORMAL;
-               ShellExecuteEx(&info);
-       }
-       return 1;       
-}
-
-void CMainFrame::OnFilePause()
-{
-       COsmo4 *app = GetApp();
-       if (app->m_stopped) {
-               char filename[5000];
-               CE_WideToChar((u16 *) (LPCTSTR) app->m_filename, filename);
-               app->m_stopped = 0;
-               gf_term_connect(app->m_term, filename);
-               app->SetBacklightState(1);
-
-               if (m_view_timing)
-                       SetTimer(PROGRESS_TIMER, PROGRESS_REFRESH_MS, ProgressTimer);
-
-               SetPauseButton();
-       } else {
-               app->Pause();
-       }
-}
-void CMainFrame::OnUpdateFilePause(CCmdUI* pCmdUI)
-{
-       COsmo4 *app = GetApp();
-       pCmdUI->Enable((app->m_open || app->m_stopped) ? TRUE : FALSE);
-}
-void CMainFrame::OnFileStop()
-{
-       COsmo4 *app = GetApp();
-       if (!app->m_open) return;
-       if (m_full_screen) OnViewFullscreen();
-       app->m_stopped = 1;
-       if (m_view_timing) KillTimer(PROGRESS_TIMER);
-       gf_term_disconnect(app->m_term);
-       m_progBar.SetPosition(0);
-       app->SetBacklightState(0);
-       SetPauseButton();
-}
-
-void CMainFrame::OnUpdateFileStop(CCmdUI* pCmdUI)
-{
-       pCmdUI->Enable( GetApp()->m_open  ? TRUE : FALSE);
-}
-
-void CMainFrame::OnFileStep()
-{
-       COsmo4 *app = GetApp();
-       gf_term_set_option(app->m_term, GF_OPT_PLAY_STATE, GF_STATE_STEP_PAUSE);
-       app->SetBacklightState(0);
-       SetPauseButton(1);
-}
-void CMainFrame::OnUpdateFileStep(CCmdUI* pCmdUI)
-{
-       pCmdUI->Enable(GetApp()->m_open ? TRUE : FALSE);
-}
-
-void CMainFrame::OnClose() 
-{
-       PostMessage(WM_DESTROY);
-}
-
-LONG CMainFrame::OnSIPChange(WPARAM wParam, LPARAM lParam)
-{
-       if (wParam == SPI_SETSIPINFO) GetApp()->ShowTaskBar(0);
-       return 1;
-}
-
-void CMainFrame::OnViewFit() 
-{
-       COsmo4 *app = GetApp();
-       app->m_fit_screen = !app->m_fit_screen;
-       if (app->m_open) OnSetSize(0, 0);
-}
-
-void CMainFrame::OnUpdateViewFit(CCmdUI* pCmdUI) 
-{
-       pCmdUI->SetCheck(GetApp()->m_fit_screen ? TRUE : FALSE);
-}
-
-void CMainFrame::OnViewArOrig() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);        
-}
-void CMainFrame::OnViewArFill() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN); 
-}
-void CMainFrame::OnViewAr43() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3); 
-}
-void CMainFrame::OnViewAr169() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9);        
-}
-
-void CMainFrame::OnNavNone() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_NONE);
-}
-
-void CMainFrame::OnNavSlide() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_SLIDE);
-}
-
-void CMainFrame::OnNaveReset() 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_NAVIGATION_TYPE, 0);
-}
-
-void CMainFrame::ForwardMessage()
-{
-       const MSG *msg = GetCurrentMessage();
-       m_wndView.SendMessage(msg->message, msg->wParam, msg->lParam);
-}
-void CMainFrame::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
-{
-       ForwardMessage(); 
-}
-void CMainFrame::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
-{
-       ForwardMessage(); 
-}
-
-
-void CMainFrame::OnViewTiming() 
-{
-       if (m_full_screen) return;
-       if (m_view_timing) KillTimer(PROGRESS_TIMER);
-       m_view_timing = !m_view_timing;
-       OnSetSize(0, 0);
-}
-
-void CMainFrame::OnUpdateViewTiming(CCmdUI* pCmdUI) 
-{
-       pCmdUI->SetCheck(m_view_timing ? TRUE : FALSE);
-}
-
-void CMainFrame::OnSetNavigation(UINT nID) 
-{
-       gf_term_set_option(GetApp()->m_term, GF_OPT_NAVIGATION, nID - ID_NAV_NONE);
-}
-
-
-void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) 
-{
-       COsmo4 *app = GetApp();
-       CFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
-
-       u32 opt = gf_term_get_option(GetApp()->m_term, GF_OPT_ASPECT_RATIO);    
-       CheckMenuItem(pPopupMenu->m_hMenu, ID_VIEW_AR_ORIG, MF_BYCOMMAND| (opt==GF_ASPECT_RATIO_KEEP) ? MF_CHECKED : MF_UNCHECKED);
-       CheckMenuItem(pPopupMenu->m_hMenu, ID_VIEW_AR_FILL, MF_BYCOMMAND| (opt==GF_ASPECT_RATIO_FILL_SCREEN) ? MF_CHECKED : MF_UNCHECKED);
-       CheckMenuItem(pPopupMenu->m_hMenu, ID_VIEW_AR_43, MF_BYCOMMAND| (opt==GF_ASPECT_RATIO_4_3) ? MF_CHECKED : MF_UNCHECKED);
-       CheckMenuItem(pPopupMenu->m_hMenu, ID_VIEW_AR_169, MF_BYCOMMAND| (opt==GF_ASPECT_RATIO_16_9) ? MF_CHECKED : MF_UNCHECKED);
-       
-       CheckMenuItem(pPopupMenu->m_hMenu, ID_VIEW_FIT, MF_BYCOMMAND| app->m_fit_screen ? MF_CHECKED : MF_UNCHECKED);
-
-       u32 type;
-       if (!app->m_open) type = GF_NAVIGATE_TYPE_NONE;
-       else type = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION_TYPE);
-
-       EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_NONE, MF_BYCOMMAND | ((type==GF_NAVIGATE_TYPE_NONE) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_SLIDE, MF_BYCOMMAND | ((type==GF_NAVIGATE_TYPE_NONE) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_RESET, MF_BYCOMMAND | ((type==GF_NAVIGATE_TYPE_NONE) ? MF_GRAYED : MF_ENABLED) );
-
-       EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_WALK, MF_BYCOMMAND | ( (type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_FLY, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_EXAMINE, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem(pPopupMenu->m_hMenu, ID_COLLIDE_OFF, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem(pPopupMenu->m_hMenu, ID_COLLIDE_REG, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem(pPopupMenu->m_hMenu, ID_COLLIDE_DISP, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem(pPopupMenu->m_hMenu, ID_NAV_GRAVITY, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-
-       if (type==GF_NAVIGATE_TYPE_NONE) {
-               u32 mode = gf_term_get_option(app->m_term, GF_OPT_NAVIGATION);
-               CheckMenuItem(pPopupMenu->m_hMenu, ID_NAV_NONE, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_NONE) ? MF_CHECKED : MF_UNCHECKED) );
-               CheckMenuItem(pPopupMenu->m_hMenu, ID_NAV_SLIDE, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_SLIDE) ? MF_CHECKED : MF_UNCHECKED) );
-               CheckMenuItem(pPopupMenu->m_hMenu, ID_NAV_WALK, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_WALK) ? MF_CHECKED : MF_UNCHECKED) );
-               CheckMenuItem(pPopupMenu->m_hMenu, ID_NAV_FLY, MF_BYCOMMAND | ((mode==GF_NAVIGATE_FLY) ? MF_CHECKED : MF_UNCHECKED) );
-               CheckMenuItem(pPopupMenu->m_hMenu, ID_NAV_EXAMINE, MF_BYCOMMAND | ((mode==GF_NAVIGATE_EXAMINE) ? MF_CHECKED : MF_UNCHECKED) );
-       }
-}
diff --git a/applications/osmo4_wce/MainFrm.h b/applications/osmo4_wce/MainFrm.h
deleted file mode 100644 (file)
index 7684b9f..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-// MainFrm.h : interface of the CMainFrame class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_MAINFRM_H__1DEE4BC7_6B56_48A8_BDD7_5DC14EF6AD3E__INCLUDED_)
-#define AFX_MAINFRM_H__1DEE4BC7_6B56_48A8_BDD7_5DC14EF6AD3E__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-#include "ProgressBar.h"
-
-
-class CChildView : public CWnd
-{
-// Construction
-public:
-       CChildView();
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CChildView)
-       protected:
-       virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
-       //}}AFX_VIRTUAL
-
-// Implementation
-public:
-       virtual ~CChildView();
-       // Generated message map functions
-protected:
-       //{{AFX_MSG(CChildView)
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-class CMainFrame : public CFrameWnd
-{
-public:
-       CMainFrame();
-
-
-
-protected: 
-       DECLARE_DYNAMIC(CMainFrame)
-
-// Attributes
-public:
-
-       ProgressBar    m_progBar;
-       Bool m_full_screen, m_restore_fs, m_view_timing;
-       u32 m_timer_on;
-       CString console_message;
-       GF_Err console_err;
-       u32 m_aspect_ratio;
-
-// Operations
-public:
-       void SetPauseButton(Bool force_play_button = 0);
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CMainFrame)
-       virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
-       afx_msg void OnSetFocus(CWnd *pOldWnd);
-       virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
-       //}}AFX_VIRTUAL
-
-// Implementation
-public:
-       virtual ~CMainFrame();
-
-/*
-#ifdef _DEBUG
-       virtual void AssertValid() const;
-       virtual void Dump(CDumpContext& dc) const;
-#endif
-*/
-
-protected:  // control bar embedded members
-
-#if (_MSC_VER >= 1300)
-       CCommandBar     m_wndCommandBar;
-#else
-       CCeCommandBar   m_wndCommandBar;
-#endif
-
-       void CloseURL();
-       void ForwardMessage();
-
-private:
-       RECT m_view_rc;
-
-public:
-       /*m_dumbWnd is used to clean the screen...*/
-       CChildView m_wndView, m_dumbWnd;
-       void UpdateTime();
-
-// Generated message map functions
-protected:
-       //{{AFX_MSG(CMainFrame)
-       afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
-       afx_msg void OnAppExit();
-       afx_msg LONG Open(WPARAM wParam, LPARAM lParam);
-       afx_msg LONG OnSIPChange(WPARAM wParam, LPARAM lParam);
-       afx_msg LONG OnSetSize(WPARAM wParam, LPARAM lParam);
-       afx_msg LONG OnNavigate(WPARAM wParam, LPARAM lParam);
-       afx_msg void OnSize(UINT nType, int cx, int cy);
-       afx_msg void OnFileStep();
-       afx_msg void OnUpdateFileStep(CCmdUI* pCmdUI);
-       afx_msg void OnFilePause();
-       afx_msg void OnUpdateFilePause(CCmdUI* pCmdUI);
-       afx_msg void OnFileStop();
-       afx_msg void OnUpdateFileStop(CCmdUI* pCmdUI);
-       afx_msg void OnViewFullscreen();
-       afx_msg void OnUpdateViewFullscreen(CCmdUI* pCmdUI);
-       afx_msg void OnClose();
-       afx_msg void OnViewFit();
-       afx_msg void OnUpdateViewFit(CCmdUI* pCmdUI);
-       afx_msg void OnViewArOrig();
-       afx_msg void OnViewArFill();
-       afx_msg void OnViewAr43();
-       afx_msg void OnViewAr169();
-       afx_msg void OnNavNone();
-       afx_msg void OnNavSlide();
-       afx_msg void OnNaveReset();
-       afx_msg void OnSetNavigation(UINT nID);
-
-       afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
-       afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
-       afx_msg void OnViewTiming();
-       afx_msg void OnUpdateViewTiming(CCmdUI* pCmdUI);
-       afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
-       //}}AFX_MSG
-
-       DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_MAINFRM_H__1DEE4BC7_6B56_48A8_BDD7_5DC14EF6AD3E__INCLUDED_)
diff --git a/applications/osmo4_wce/OpenDlg.cpp b/applications/osmo4_wce/OpenDlg.cpp
deleted file mode 100644 (file)
index 6a58e7c..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-// OpenDlg.cpp : implementation file
-//
-#include "stdafx.h"
-#include "resource.h"
-#include "OpenDlg.h"
-#include "Osmo4.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// OpenDlg dialog
-
-
-OpenDlg::OpenDlg(CWnd* pParent /*=NULL*/)
-       : CDialog(OpenDlg::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(OpenDlg)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void OpenDlg::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(OpenDlg)
-       DDX_Control(pDX, IDC_FILELIST, m_URLs);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(OpenDlg, CDialog)
-       //{{AFX_MSG_MAP(OpenDlg)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-void OpenDlg::OnOK() 
-{
-       CString URL;
-       char szUrl[5000];
-
-       int sel = m_URLs.GetCurSel();
-       if (sel == CB_ERR) {
-               m_URLs.GetWindowText(URL);
-       } else {
-               m_URLs.GetLBText(sel, URL);
-       }
-       if (!URL.GetLength()) {
-               EndDialog(IDCANCEL);
-               return;
-       }
-       COsmo4 *app = GetApp();
-       u32 nb_entries;
-
-       app->m_filename = URL;
-
-       CE_WideToChar((unsigned short *) (LPCTSTR) URL, szUrl);
-
-       gf_cfg_set_key(app->m_user.config, "RecentFiles", szUrl, NULL);
-       gf_cfg_insert_key(app->m_user.config, "RecentFiles", szUrl, "", 0);
-       /*remove last entry if needed*/
-       nb_entries = gf_cfg_get_key_count(app->m_user.config, "RecentFiles");
-       if (nb_entries>20) {
-               gf_cfg_set_key(app->m_user.config, "RecentFiles", gf_cfg_get_key_name(app->m_user.config, "RecentFiles", nb_entries-1), NULL);
-       }
-       EndDialog(IDOK);
-}
-
-BOOL OpenDlg::OnInitDialog() 
-{
-       TCHAR w_str[5000];
-       CDialog::OnInitDialog();
-       COsmo4 *app = GetApp();
-       const char *sOpt;
-       u32 i=0;
-
-       while (m_URLs.GetCount()) m_URLs.DeleteString(0);
-       while (1) {
-               sOpt = gf_cfg_get_key_name(app->m_user.config, "RecentFiles", i);
-               if (!sOpt) break;
-               CE_CharToWide((char *) sOpt, (u16 *)w_str);
-               m_URLs.AddString(w_str);
-               i++;
-       }
-
-       SetFocus();
-       return TRUE;  
-}
diff --git a/applications/osmo4_wce/OpenDlg.h b/applications/osmo4_wce/OpenDlg.h
deleted file mode 100644 (file)
index efc8724..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#if !defined(AFX_OPENDLG_H__DD903B38_EA45_4251_A8C9_4E4B08BECCCC__INCLUDED_)
-#define AFX_OPENDLG_H__DD903B38_EA45_4251_A8C9_4E4B08BECCCC__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// OpenDlg.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// OpenDlg dialog
-
-class OpenDlg : public CDialog
-{
-// Construction
-public:
-       OpenDlg(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(OpenDlg)
-       enum { IDD = IDD_OPENFILE };
-       CComboBox       m_URLs;
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(OpenDlg)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(OpenDlg)
-       virtual void OnOK();
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_OPENDLG_H__DD903B38_EA45_4251_A8C9_4E4B08BECCCC__INCLUDED_)
diff --git a/applications/osmo4_wce/Options.cpp b/applications/osmo4_wce/Options.cpp
deleted file mode 100644 (file)
index a70ea56..0000000
+++ /dev/null
@@ -1,1230 +0,0 @@
-// Options.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-#include <gpac/options.h>
-#include <gpac/modules/audio_out.h>
-#include <gpac/modules/codec.h>
-#include <gpac/modules/font.h>
-#include <gpac/constants.h>
-#include <gpac/iso639.h>
-
-#include "Options.h"
-#include <gx.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions dialog
-
-
-COptions::COptions(CWnd* pParent /*=NULL*/)
-       : CDialog(COptions::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptions)
-       //}}AFX_DATA_INIT
-
-}
-
-
-void COptions::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptions)
-       DDX_Control(pDX, IDC_COMBOSEL, m_Selection);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptions, CDialog)
-       //{{AFX_MSG_MAP(COptions)
-       ON_BN_CLICKED(IDC_SAVEOPT, OnSaveopt)
-       ON_CBN_SELCHANGE(IDC_COMBOSEL, OnSelchangeCombosel)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions message handlers
-
-
-void COptions::OnSelchangeCombosel() 
-{
-       HideAll();
-       switch (m_Selection.GetCurSel()) {
-       case 0: m_general.ShowWindow(SW_SHOW); break;
-       case 1: m_systems.ShowWindow(SW_SHOW); break;
-       case 2: m_decoder.ShowWindow(SW_SHOW); break;
-       case 3: m_render.ShowWindow(SW_SHOW); break;
-       case 4: m_render3D.ShowWindow(SW_SHOW); break;
-       case 5: m_audio.ShowWindow(SW_SHOW); break;
-       case 6: m_font.ShowWindow(SW_SHOW); break;
-       case 7: m_http.ShowWindow(SW_SHOW); break;
-       case 8: m_stream.ShowWindow(SW_SHOW); break;
-       }
-}
-
-void COptions::HideAll()
-{
-       m_general.ShowWindow(SW_HIDE);
-       m_systems.ShowWindow(SW_HIDE);
-       m_render.ShowWindow(SW_HIDE);
-       m_render3D.ShowWindow(SW_HIDE);
-       m_audio.ShowWindow(SW_HIDE);
-       m_http.ShowWindow(SW_HIDE);
-       m_font.ShowWindow(SW_HIDE);
-       m_stream.ShowWindow(SW_HIDE);
-       m_decoder.ShowWindow(SW_HIDE);
-}
-
-BOOL COptions::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-       m_general.Create(IDD_OPT_GEN, this);
-       m_systems.Create(IDD_OPT_SYSTEMS, this);
-       m_decoder.Create(IDD_OPT_DECODER, this);
-       m_render.Create(IDD_OPT_RENDER, this);
-       m_render3D.Create(IDD_OPT_RENDER3D, this);
-       m_audio.Create(IDD_OPT_AUDIO, this);
-       m_http.Create(IDD_OPT_HTTP, this);
-       m_font.Create(IDD_OPT_FONT, this);
-       m_stream.Create(IDD_OPT_STREAM, this);
-
-       m_Selection.AddString(_T("General"));
-       m_Selection.AddString(_T("MPEG-4 Systems"));
-       m_Selection.AddString(_T("Decoders"));
-       m_Selection.AddString(_T("Compositor"));
-       m_Selection.AddString(_T("3D Rendering"));
-       m_Selection.AddString(_T("Audio"));
-       m_Selection.AddString(_T("Text"));
-       m_Selection.AddString(_T("Download"));
-       m_Selection.AddString(_T("Streaming"));
-       HideAll();
-
-       const char *sOpt = gf_cfg_get_key(GetApp()->m_user.config, "General", "ConfigPanel");
-       u32 sel = sOpt ? atoi(sOpt) : 0;
-       if (sel>8) sel=8;
-       m_Selection.SetCurSel(sel);
-       OnSelchangeCombosel();
-
-       SetFocus();
-       return TRUE;  
-}
-
-void COptions::OnSaveopt() 
-{
-       m_general.SaveOptions();
-       m_systems.SaveOptions();
-       m_render.SaveOptions();
-       m_render3D.SaveOptions();
-       m_audio.SaveOptions();
-       m_http.SaveOptions();
-       m_font.SaveOptions();
-       m_stream.SaveOptions();
-       m_decoder.SaveOptions();
-
-       COsmo4 *gpac = GetApp();
-       gf_term_set_option(gpac->m_term, GF_OPT_RELOAD_CONFIG, 1);
-}
-
-void COptions::OnOK() 
-{
-       char str[20];
-       sprintf(str, "%d", m_Selection.GetCurSel());
-       gf_cfg_set_key(GetApp()->m_user.config, "General", "ConfigPanel", str);
-
-       EndDialog(IDCANCEL);
-}
-
-
-
-COptAudio::COptAudio(CWnd* pParent /*=NULL*/)
-       : CDialog(COptAudio::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptAudio)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptAudio::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptAudio)
-       DDX_Control(pDX, IDC_DRIVER_LIST, m_DriverList);
-       DDX_Control(pDX, IDC_AUDIO_RESYNC, m_AudioResync);
-       DDX_Control(pDX, IDC_AUDIO_DUR, m_AudioDur);
-       DDX_Control(pDX, IDC_SPIN_DUR, m_SpinDur);
-       DDX_Control(pDX, IDC_FORCE_AUDIO, m_ForceConfig);
-       DDX_Control(pDX, IDC_SPIN_AUDIO, m_AudioSpin);
-       DDX_Control(pDX, IDC_EDIT_AUDIO, m_AudioEdit);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptAudio, CDialog)
-       //{{AFX_MSG_MAP(COptAudio)
-       ON_BN_CLICKED(IDC_FORCE_AUDIO, OnForceAudio)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptAudio message handlers
-
-BOOL COptAudio::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-
-       m_AudioSpin.SetBuddy(& m_AudioEdit);
-       m_SpinDur.SetBuddy(& m_AudioDur);
-       m_SpinDur.SetRange(0, 1000);
-
-       COsmo4 *gpac = GetApp();
-       const char *sOpt;
-       TCHAR wTmp[500];
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "ForceConfig");
-       m_ForceConfig.SetCheck( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "NumBuffers");
-       if (sOpt) {
-               CE_CharToWide((char *)sOpt, (u16 *)wTmp);
-               m_AudioEdit.SetWindowText(wTmp);
-       } else {
-               m_AudioEdit.SetWindowText(_T("2"));
-       }
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "TotalDuration");
-       if (sOpt) {
-               CE_CharToWide((char *)sOpt, (u16 *)wTmp);
-               m_AudioDur.SetWindowText(wTmp);
-       } else {
-               m_AudioDur.SetWindowText(_T("200"));
-       }
-
-       OnForceAudio();
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "NoResync");
-       if (sOpt && !stricmp(sOpt, "yes")) {
-               m_AudioResync.SetCheck(1);
-       } else {
-               m_AudioResync.SetCheck(0);
-       }
-       
-       /*driver enum*/
-       while (m_DriverList.GetCount()) m_DriverList.DeleteString(0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Audio", "DriverName");
-       u32 count = gf_modules_get_count(gpac->m_user.modules);
-       GF_BaseInterface *ifce;
-       s32 select = 0;
-       s32 to_sel = 0;
-       for (u32 i=0; i<count; i++) {
-               ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_AUDIO_OUTPUT_INTERFACE);
-               if (!ifce) continue;
-               if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
-               CE_CharToWide((char *) ((GF_BaseInterface *)ifce)->module_name, (u16 *)wTmp);
-               m_DriverList.AddString(wTmp);
-               gf_modules_close_interface(ifce);
-               to_sel++;
-       }
-       m_DriverList.SetCurSel(select);
-       
-       
-       return TRUE;  
-}
-
-
-void COptAudio::SaveOptions()
-{
-       COsmo4 *gpac = GetApp();
-       TCHAR wstr[50];
-       char str[50];
-
-       gf_cfg_set_key(gpac->m_user.config, "Audio", "ForceConfig", m_ForceConfig.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Audio", "NoResync", m_AudioResync.GetCheck() ? "yes" : "no");
-
-       m_AudioEdit.GetWindowText(wstr, 20);
-       CE_WideToChar((u16 *)wstr, str);
-       gf_cfg_set_key(gpac->m_user.config, "Audio", "NumBuffers", str);
-       m_AudioDur.GetWindowText(wstr, 20);
-       CE_WideToChar((u16 *)wstr, str);
-       gf_cfg_set_key(gpac->m_user.config, "Audio", "TotalDuration", str);
-
-       m_DriverList.GetWindowText(wstr, 50);
-       CE_WideToChar((u16 *)wstr, str);
-       gf_cfg_set_key(gpac->m_user.config, "Audio", "DriverName", str);
-
-}
-
-void COptAudio::OnForceAudio() 
-{
-       BOOL en = m_ForceConfig.GetCheck();
-
-       m_AudioSpin.EnableWindow(en);
-       m_AudioEdit.EnableWindow(en);
-       m_SpinDur.EnableWindow(en);
-       m_AudioDur.EnableWindow(en);
-}
-
-
-COptDecoder::COptDecoder(CWnd* pParent /*=NULL*/)
-       : CDialog(COptDecoder::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptDecoder)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void COptDecoder::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptDecoder)
-       DDX_Control(pDX, IDC_VIDEC_LIST, m_Video);
-       DDX_Control(pDX, IDC_AUDEC_LIST, m_Audio);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptDecoder, CDialog)
-       //{{AFX_MSG_MAP(COptDecoder)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptDecoder message handlers
-
-BOOL COptDecoder::OnInitDialog() 
-{
-       u32 i;
-       CDialog::OnInitDialog();
-       
-       COsmo4 *gpac = GetApp();
-       const char *sOpt;
-
-       /*audio dec enum*/
-       while (m_Audio.GetCount()) m_Audio.DeleteString(0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "DefAudioDec");
-       u32 count = gf_modules_get_count(gpac->m_user.modules);
-       GF_BaseDecoder *ifce;
-       s32 select = 0;
-       s32 to_sel = 0;
-       for (i=0; i<count; i++) {
-               ifce = (GF_BaseDecoder *) gf_modules_load_interface(gpac->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
-               if (!ifce) continue;
-               if (ifce->CanHandleStream(ifce, GF_STREAM_AUDIO, NULL, 0)) {
-                       if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
-                       TCHAR wzTmp[500];
-                       CE_CharToWide((char *) ifce->module_name, (u16 *)wzTmp);
-                       m_Audio.AddString(wzTmp);
-                       to_sel++;
-               }
-               gf_modules_close_interface((GF_BaseInterface *) ifce);
-       }
-       m_Audio.SetCurSel(select);
-
-       /*audio dec enum*/
-       while (m_Video.GetCount()) m_Video.DeleteString(0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "DefVideoDec");
-       count = gf_modules_get_count(gpac->m_user.modules);
-       select = 0;
-       to_sel = 0;
-       for (i=0; i<count; i++) {
-               ifce  = (GF_BaseDecoder *) gf_modules_load_interface(gpac->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
-               if (!ifce) continue;
-               if (ifce->CanHandleStream(ifce, GF_STREAM_VISUAL, NULL, 0)) {
-                       if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
-                       TCHAR wzTmp[500];
-                       CE_CharToWide((char *) ifce->module_name, (u16 *)wzTmp);
-                       m_Video.AddString(wzTmp);
-                       to_sel++;
-               }
-               gf_modules_close_interface((GF_BaseInterface *) ifce);
-       }
-       m_Video.SetCurSel(select);
-
-       return TRUE;
-}
-
-void COptDecoder::SaveOptions()
-{
-       COsmo4 *gpac = GetApp();
-       TCHAR wstr[100];
-       char str[100];
-
-       m_Audio.GetWindowText(wstr, 50);
-       CE_WideToChar((u16 *)wstr, str);
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "DefAudioDec", str);
-       m_Video.GetWindowText(wstr, 50);
-       CE_WideToChar((u16 *)wstr, str);
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "DefVideoDec", str);
-}
-
-
-
-COptFont::COptFont(CWnd* pParent /*=NULL*/)
-       : CDialog(COptFont::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptFont)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptFont::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptFont)
-       DDX_Control(pDX, IDC_USE_TEXTURE, m_UseTexture);
-       DDX_Control(pDX, IDC_FONT_LIST, m_Fonts);
-       DDX_Control(pDX, IDC_BROWSE_FONT, m_BrowseFont);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptFont, CDialog)
-       //{{AFX_MSG_MAP(COptFont)
-       ON_BN_CLICKED(IDC_BROWSE_FONT, OnBrowseFont)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptFont message handlers
-
-BOOL COptFont::OnInitDialog() 
-{
-       u32 i;
-       GF_BaseInterface *ifce;
-       
-       CDialog::OnInitDialog();
-       
-       COsmo4 *gpac = GetApp();
-       TCHAR wTmp[500];
-       const char *sOpt;
-
-       /*video drivers enum*/
-       while (m_Fonts.GetCount()) m_Fonts.DeleteString(0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "FontEngine", "DriverName");
-       s32 to_sel = 0;
-       s32 select = 0;
-       u32 count = gf_modules_get_count(gpac->m_user.modules);
-       for (i=0; i<count; i++) {
-               ifce = gf_modules_load_interface(gpac->m_user.modules, i, GF_FONT_READER_INTERFACE);
-               if (!ifce) continue;
-               if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
-               CE_CharToWide((char *) ifce->module_name, (u16 *)wTmp);
-               m_Fonts.AddString(wTmp);
-               gf_modules_close_interface(ifce);
-               to_sel++;
-       }
-       m_Fonts.SetCurSel(select);
-       
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "FontEngine", "FontDirectory");
-       CE_CharToWide((char *)sOpt, (u16 *)wTmp);
-       if (sOpt) m_BrowseFont.SetWindowText(wTmp);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "TextureTextMode");
-       m_UseTexture.SetCheck( (!sOpt || stricmp(sOpt, "Never")) ? 1 : 0);
-
-       return TRUE;  
-}
-
-void COptFont::OnBrowseFont() 
-{
-
-}
-
-
-void COptFont::SaveOptions()
-{
-       COsmo4 *gpac = GetApp();
-       char str[MAX_PATH];
-       TCHAR wstr[MAX_PATH];
-               
-       m_Fonts.GetWindowText(wstr, 50);
-       CE_WideToChar((u16 *)wstr, str);
-       gf_cfg_set_key(gpac->m_user.config, "FontEngine", "FontReader", str);
-       m_BrowseFont.GetWindowText(wstr, 50);
-       CE_WideToChar((u16 *)wstr, str);
-       gf_cfg_set_key(gpac->m_user.config, "FontEngine", "FontDirectory", str);
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "TextureTextMode", m_UseTexture.GetCheck() ? "Default" : "Never");
-}
-
-
-
-COptGen::COptGen(CWnd* pParent /*=NULL*/)
-       : CDialog(COptGen::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptGen)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptGen::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptGen)
-       DDX_Control(pDX, IDC_NO_BACKLIGHT, m_NoBacklight);
-       DDX_Control(pDX, IDC_FILL_SCREEN, m_Fill);
-       DDX_Control(pDX, IDC_LOOP, m_Loop);
-       DDX_Control(pDX, IDC_ENABLE_LOGS, m_Logs);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptGen, CDialog)
-       //{{AFX_MSG_MAP(COptGen)
-       ON_BN_CLICKED(IDC_FILEASSOC, OnFileassoc)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptGen message handlers
-
-
-
-BOOL COptGen::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       COsmo4 *gpac = GetApp();
-       const char *sOpt;
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "Loop");
-       if (sOpt && !stricmp(sOpt, "yes")) {
-               m_Loop.SetCheck(1);
-       } else {
-               m_Loop.SetCheck(0);
-       }
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "FillScreen");
-       m_Fill.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "DisableBackLight");
-       m_NoBacklight.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "LogLevel");
-       m_Logs.SetCheck((sOpt && !stricmp(sOpt, "debug")) ? 1 : 0);
-       return TRUE; 
-}
-
-void COptGen::SaveOptions()
-{
-       COsmo4 *gpac = GetApp();
-
-       gpac->m_Loop = m_Loop.GetCheck();
-       gf_cfg_set_key(gpac->m_user.config, "General", "Loop", gpac->m_Loop ? "yes" : "no");
-       gpac->m_fit_screen = m_Fill.GetCheck();
-       gf_cfg_set_key(gpac->m_user.config, "General", "FillScreen", gpac->m_fit_screen ? "yes" : "no");
-       gpac->m_disable_backlight = m_NoBacklight.GetCheck();
-       gf_cfg_set_key(gpac->m_user.config, "General", "DisableBackLight", gpac->m_disable_backlight ? "yes" : "no");
-
-       gpac->EnableLogs(m_Logs.GetCheck() ? 1 : 0);
-}
-
-void COptGen::OnFileassoc() 
-{
-       HKEY hSection;
-       TCHAR szDir[MAX_PATH];
-       char szTemp[MAX_PATH];
-       TCHAR cmd[MAX_PATH];
-       DWORD ioSize = MAX_PATH;
-       DWORD dwDisp;
-
-       RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Osmo4"), 0, KEY_READ, &hSection);
-       
-       GetModuleFileName(NULL, szDir, MAX_PATH);
-
-       while (szDir[strlen((char *) szDir)-1] != (TCHAR) '\\') szDir[strlen((char *) szDir)-1] = 0;
-       if (!hSection) 
-               RegCreateKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Osmo4"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hSection, &dwDisp);
-
-       CE_WideToChar((u16 *)szDir, szTemp);
-       /*overwrite install dir with current path*/
-       RegSetValueEx(hSection, _T("Install_Dir"), 0, REG_SZ, (const unsigned char *) szTemp, strlen(szTemp)+1);
-       RegCloseKey(hSection);
-
-
-       /*overwrite .mp4 file associations */
-       RegCreateKeyEx(HKEY_CLASSES_ROOT, _T("mp4file\\DefaultIcon"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hSection, &dwDisp);
-       wcscpy(cmd, szDir);
-       wcscat(cmd, _T("Osmo4.ico") );
-       CE_WideToChar((u16 *)cmd, szTemp);
-
-       RegSetValueEx(hSection, _T(""), 0, REG_SZ, (const unsigned char *) szTemp, strlen((const char *) szTemp)+1);
-       RegCloseKey(hSection);
-
-       RegCreateKeyEx(HKEY_CLASSES_ROOT, _T("mp4file\\Shell\\open\\command"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hSection, &dwDisp);
-       wcscpy(cmd, szDir);
-       wcscat(cmd, _T("Osmo4.exe \"%L\"") );
-       CE_WideToChar((u16 *)cmd, szTemp);
-       RegSetValueEx(hSection, _T(""), 0, REG_SZ, (const unsigned char *) szTemp, strlen(szTemp)+1);
-       RegCloseKey(hSection);
-
-       RegCreateKeyEx(HKEY_CLASSES_ROOT, _T(".mp4"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hSection, &dwDisp);
-       RegSetValueEx(hSection, _T(""), 0, REG_SZ, (const unsigned char *) "mp4file", strlen("mp4file")+1);
-       RegCloseKey(hSection);
-}
-
-
-
-COptHTTP::COptHTTP(CWnd* pParent /*=NULL*/)
-       : CDialog(COptHTTP::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptHTTP)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptHTTP::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptHTTP)
-       DDX_Control(pDX, IDC_RESTART_CACHE, m_RestartFile);
-       DDX_Control(pDX, IDC_CLEAN_CACHE, m_CleanCache);
-       DDX_Control(pDX, IDC_BROWSE_CACHE, m_CacheDir);
-       DDX_Control(pDX, IDC_SAX_PROGRESSIVE, m_Progressive);
-       DDX_Control(pDX, IDC_SAX_DURATION, m_SaxDuration);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptHTTP, CDialog)
-       //{{AFX_MSG_MAP(COptHTTP)
-       ON_BN_CLICKED(IDC_BROWSE_CACHE, OnBrowseCache)
-       ON_BN_CLICKED(IDC_SAX_PROGRESSIVE, OnProgressive)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptHTTP message handlers
-
-
-void COptHTTP::OnBrowseCache() 
-{
-
-}
-
-BOOL COptHTTP::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-       COsmo4 *gpac = GetApp();
-       TCHAR wTmp[500];
-       const char *sOpt;
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Downloader", "CleanCache");
-       m_CleanCache.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Downloader", "RestartFiles");
-       m_RestartFile.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "SAXLoader", "Progressive");
-       m_Progressive.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "SAXLoader", "MaxDuration");
-       if (sOpt) {
-               CE_CharToWide((char *) sOpt, (u16 *)wTmp);
-               m_SaxDuration.SetWindowText(wTmp);
-       } else {
-               m_SaxDuration.SetWindowText( _T("30") );
-       }
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "General", "CacheDirectory");
-       CE_CharToWide((char *) sOpt, (u16 *)wTmp);
-       if (sOpt) m_CacheDir.SetWindowText(wTmp);
-       
-       OnProgressive();
-       return TRUE; 
-}
-
-void COptHTTP::OnProgressive()
-{
-       m_SaxDuration.EnableWindow( m_Progressive.GetCheck() ? TRUE : FALSE );
-}
-
-void COptHTTP::SaveOptions()
-{
-       TCHAR wTmp[500];
-       char szCacheDir[500];
-       COsmo4 *gpac = GetApp();
-
-       gf_cfg_set_key(gpac->m_user.config, "Downloader", "CleanCache", m_CleanCache.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Downloader", "RestartFiles", m_RestartFile.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "SAXLoader", "Progressive", m_Progressive.GetCheck() ? "yes" : "no");
-
-       m_SaxDuration.GetWindowText(wTmp, MAX_PATH);
-       CE_WideToChar((u16 *)wTmp, szCacheDir);
-       gf_cfg_set_key(gpac->m_user.config, "SAXLoader", "MaxDuration", szCacheDir);
-
-       m_CacheDir.GetWindowText(wTmp, MAX_PATH);
-       CE_WideToChar((u16 *)wTmp, szCacheDir);
-       gf_cfg_set_key(gpac->m_user.config, "General", "CacheDirectory", szCacheDir);
-}
-
-
-
-COptRender::COptRender(CWnd* pParent /*=NULL*/)
-       : CDialog(COptRender::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptRender)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptRender::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptRender)
-       DDX_Control(pDX, IDC_AA_LIST, m_Antialias);
-       DDX_Control(pDX, IDC_FORCE_SIZE, m_ForceSize);
-       DDX_Control(pDX, IDC_FAST_RENDER, m_HighSpeed);
-       DDX_Control(pDX, IDC_ZOOM_SCALABLE, m_Scalable);
-       DDX_Control(pDX, IDC_DIRECTRENDER, m_DirectRender);
-       DDX_Control(pDX, IDC_BIFS_RATE, m_BIFSRate);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptRender, CDialog)
-       //{{AFX_MSG_MAP(COptRender)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptRender message handlers
-
-
-
-#define NUM_RATES 11
-static char *BIFSRates[11] = 
-{
-       "5.0",
-       "7.5",
-       "10.0",
-       "12.5",
-       "15.0",
-       "24.0",
-       "25.0",
-       "30.0",
-       "50.0",
-       "60.0",
-       "100.0",
-};
-
-
-
-BOOL COptRender::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-       COsmo4 *gpac = GetApp();
-       const char *sOpt;
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DirectDraw");
-       if (sOpt && !stricmp(sOpt, "yes")) {
-               m_DirectRender.SetCheck(1);
-       } else {
-               m_DirectRender.SetCheck(0);
-       }
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "ScalableZoom");
-       if (sOpt && !stricmp(sOpt, "no")) {
-               m_Scalable.SetCheck(0);
-       } else {
-               m_Scalable.SetCheck(1);
-       }
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "ForceSceneSize");
-       if (sOpt && !stricmp(sOpt, "yes")) {
-               m_ForceSize.SetCheck(1);
-       } else {
-               m_ForceSize.SetCheck(0);
-       }
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "FrameRate");
-       if (!sOpt) sOpt = "30.0";
-       s32 select = 0;
-       while (m_BIFSRate.GetCount()) m_BIFSRate.DeleteString(0);
-       for (s32 i = 0; i<NUM_RATES; i++) {
-               TCHAR szText[100];
-               CE_CharToWide(BIFSRates[i], (u16 *)szText);
-               m_BIFSRate.AddString(szText);
-               if (sOpt && !stricmp(sOpt, BIFSRates[i]) ) select = i;
-       }
-       m_BIFSRate.SetCurSel(select);
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "HighSpeed");
-       m_HighSpeed.SetCheck((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "AntiAlias");
-       while (m_Antialias.GetCount()) m_Antialias.DeleteString(0);
-
-       m_Antialias.AddString(_T("None"));
-       m_Antialias.AddString(_T("Text only"));
-       m_Antialias.AddString(_T("Complete"));
-       select = 2;
-       if (sOpt && !stricmp(sOpt, "Text")) select = 1;
-       else if (sOpt && !stricmp(sOpt, "None")) select = 0;
-       m_Antialias.SetCurSel(select);
-
-       return TRUE;  
-}
-
-
-void COptRender::SaveOptions()
-{
-       COsmo4 *gpac = GetApp();
-
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "DirectDraw", m_DirectRender.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "ScalableZoom", m_Scalable.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "HighSpeed", m_HighSpeed.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "ForceSceneSize", m_ForceSize.GetCheck() ? "yes" : "no");
-
-       s32 sel = m_BIFSRate.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "FrameRate", BIFSRates[sel]);
-
-       sel = m_Antialias.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "AntiAlias", (sel==0) ? "None" : ( (sel==1) ? "Text" : "All"));
-}
-
-
-
-
-COptRender3D::COptRender3D(CWnd* pParent /*=NULL*/)
-       : CDialog(COptRender3D::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptRender)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptRender3D::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptRender)
-       DDX_Control(pDX, IDC_WIRE_MODE, m_WireMode);
-       DDX_Control(pDX, IDC_DRAW_NORMALS, m_DrawNormals);
-       DDX_Control(pDX, IDC_USE_3D_REN, m_Use3DRender);
-       DDX_Control(pDX, IDC_NO_BACKCULL, m_NoBackFace);
-       DDX_Control(pDX, IDC_EMULATE_POW2, m_EmulatePOW2);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptRender3D, CDialog)
-       //{{AFX_MSG_MAP(COptRender3D)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-BOOL COptRender3D::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-       COsmo4 *gpac = GetApp();
-       const char *sOpt;
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "ForceOpenGL");
-       m_Use3DRender.SetCheck( (sOpt && !strcmp(sOpt, "yes")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "BackFaceCulling");
-       m_NoBackFace.SetCheck( (sOpt && !stricmp(sOpt, "Off")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "EmulatePOW2");
-       m_EmulatePOW2.SetCheck( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       m_WireMode.ResetContent();
-       m_WireMode.AddString(_T("Solid Draw"));
-       m_WireMode.AddString(_T("Wireframe"));
-       m_WireMode.AddString(_T("Both"));
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "Wireframe");
-       if (sOpt && !stricmp(sOpt, "WireOnly")) m_WireMode.SetCurSel(1);
-       else if (sOpt && !stricmp(sOpt, "WireOnSolid")) m_WireMode.SetCurSel(2);
-       else m_WireMode.SetCurSel(0);
-
-
-       m_DrawNormals.ResetContent();
-       m_DrawNormals.AddString(_T("Never"));
-       m_DrawNormals.AddString(_T("Per Face"));
-       m_DrawNormals.AddString(_T("Per Vertex"));
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Compositor", "DrawNormals");
-       if (sOpt && !stricmp(sOpt, "PerFace")) m_DrawNormals.SetCurSel(1);
-       else if (sOpt && !stricmp(sOpt, "PerVertex")) m_DrawNormals.SetCurSel(2);
-       else m_DrawNormals.SetCurSel(0);
-
-       return TRUE;  
-}
-
-
-void COptRender3D::SaveOptions()
-{
-       COsmo4 *gpac = GetApp();
-
-       u32 sel = m_DrawNormals.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "DrawNormals", (sel==2) ? "PerVertex" : (sel==1) ? "PerFace" : "Never");
-       
-       sel = m_WireMode.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "Wireframe", (sel==2) ? "WireOnSolid" : (sel==1) ? "WireOnly" : "WireNone");
-
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "BackFaceCulling", m_NoBackFace.GetCheck() ? "Off" : "On");
-       gf_cfg_set_key(gpac->m_user.config, "Compositor", "EmulatePOW2", m_EmulatePOW2.GetCheck() ? "yes" : "no");
-}
-
-
-COptStream::COptStream(CWnd* pParent /*=NULL*/)
-       : CDialog(COptStream::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptStream)
-       //}}AFX_DATA_INIT
-}
-
-
-void COptStream::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptStream)
-       DDX_Control(pDX, IDC_REBUFFER_LEN, m_RebufferLen);
-       DDX_Control(pDX, IDC_REBUFFER, m_Rebuffer);
-       DDX_Control(pDX, IDC_BUFFER, m_Buffer);
-       DDX_Control(pDX, IDC_TIMEOUT, m_Timeout);
-       DDX_Control(pDX, IDC_REORDER, m_Reorder);
-       DDX_Control(pDX, IDC_RTSP, m_UseRTSP);
-       DDX_Control(pDX, IDC_PORT, m_Port);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptStream, CDialog)
-       //{{AFX_MSG_MAP(COptStream)
-       ON_CBN_SELCHANGE(IDC_PORT, OnSelchangePort)
-       ON_BN_CLICKED(IDC_RTSP, OnRtsp)
-       ON_BN_CLICKED(IDC_REBUFFER, OnRebuffer)
-       ON_EN_UPDATE(IDC_REBUFFER_LEN, OnUpdateRebufferLen)
-       ON_EN_UPDATE(IDC_BUFFER, OnUpdateBuffer)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptStream message handlers
-
-BOOL COptStream::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-
-       COsmo4 *gpac = GetApp();
-       TCHAR wTmp[500];
-       const char *sOpt;
-
-       while (m_Port.GetCount()) m_Port.DeleteString(0);
-       m_Port.AddString(_T("554 (RTSP standard)"));
-       m_Port.AddString(_T("7070 (RTSP ext)"));
-       m_Port.AddString(_T("80 (RTSP / HTTP tunnel)"));
-       m_Port.AddString(_T("8080 (RTSP / HTTP tunnel)"));
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "DefaultPort");
-       u32 port = 554;
-       Bool force_rtsp = 0;;
-       if (sOpt) port = atoi(sOpt);
-       switch (port) {
-       case 8080:
-               m_Port.SetCurSel(3);
-               force_rtsp = 1;
-               break;
-       case 80:
-               m_Port.SetCurSel(2);
-               force_rtsp = 1;
-               break;
-       case 7070:
-               m_Port.SetCurSel(1);
-               break;
-       default:
-               m_Port.SetCurSel(0);
-               break;
-       }
-
-       Bool use_rtsp = 0;
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "RTPoverRTSP");
-       if (sOpt && !stricmp(sOpt, "yes")) use_rtsp = 1;
-
-       if (force_rtsp) {
-               m_UseRTSP.SetCheck(1);
-               m_UseRTSP.EnableWindow(0);
-               m_Reorder.SetCheck(0);
-               m_Reorder.EnableWindow(0);
-       } else {
-               m_UseRTSP.SetCheck(use_rtsp);
-               m_UseRTSP.EnableWindow(1);
-               m_Reorder.EnableWindow(1);
-               sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "ReorderSize");
-               if (sOpt && !stricmp(sOpt, "0")) {
-                       m_Reorder.SetCheck(0);
-               } else {
-                       m_Reorder.SetCheck(1);
-               }
-       }
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Streaming", "RTSPTimeout");
-       if (sOpt) {
-               CE_CharToWide((char *) sOpt, (u16 *)wTmp);
-               m_Timeout.SetWindowText(wTmp);
-       } else {
-               m_Timeout.SetWindowText(_T("30000"));
-       }
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Network", "BufferLength");
-       if (sOpt) {
-               CE_CharToWide((char *) sOpt, (u16 *)wTmp);
-               m_Buffer.SetWindowText(wTmp);
-       } else {
-               m_Buffer.SetWindowText(_T("3000"));
-       }
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Network", "RebufferLength");
-       u32 buf_len = 0;
-       if (sOpt) buf_len = atoi(sOpt);
-       if (buf_len) {
-               CE_CharToWide((char *) sOpt, (u16 *)wTmp);
-               m_RebufferLen.SetWindowText(wTmp);
-               m_Rebuffer.SetCheck(1);
-               m_RebufferLen.EnableWindow(1);
-       } else {
-               m_RebufferLen.SetWindowText(_T("0"));
-               m_Rebuffer.SetCheck(0);
-               m_RebufferLen.EnableWindow(0);
-       }
-
-       return TRUE;  
-}
-
-
-void COptStream::OnSelchangePort() 
-{
-       s32 sel = m_Port.GetCurSel();
-       switch (sel) {
-       case 3:
-       case 2:
-               m_UseRTSP.SetCheck(1);
-               m_UseRTSP.EnableWindow(0);
-               m_Reorder.SetCheck(0);
-               m_Reorder.EnableWindow(0);
-               break;
-       case 1:
-       default:
-               m_UseRTSP.SetCheck(0);
-               m_UseRTSP.EnableWindow(1);
-               m_Reorder.SetCheck(1);
-               m_Reorder.EnableWindow(1);
-               break;
-       }
-}
-
-void COptStream::OnRtsp() 
-{
-       if (m_UseRTSP.GetCheck()) {
-               m_Reorder.SetCheck(0);
-               m_Reorder.EnableWindow(0);
-       } else {
-               m_Reorder.SetCheck(1);
-               m_Reorder.EnableWindow(1);
-       }
-       
-}
-
-void COptStream::CheckRebuffer()
-{
-       TCHAR wstr[50];
-       char str[50];
-       s32 buf, rebuf;
-       m_Buffer.GetWindowText(wstr, 50);
-       CE_WideToChar((u16 *)wstr, str);
-       buf = atoi(str);
-       m_RebufferLen.GetWindowText(wstr, 50);
-       CE_WideToChar((u16 *)wstr, str);
-       rebuf = atoi(str);
-       if (rebuf*2 > buf) {
-               rebuf = buf/2;
-               wsprintf(wstr, _T("%d"), rebuf);
-               m_RebufferLen.SetWindowText(wstr);
-       }
-}
-
-void COptStream::OnRebuffer() 
-{
-       if (!m_Rebuffer.GetCheck()) {
-               m_RebufferLen.EnableWindow(0);
-       } else {
-               m_RebufferLen.EnableWindow(1);
-               CheckRebuffer();
-       }
-}
-
-void COptStream::OnUpdateRebufferLen() 
-{
-       CheckRebuffer();
-}
-
-void COptStream::OnUpdateBuffer() 
-{
-       CheckRebuffer();        
-}
-
-void COptStream::SaveOptions()
-{
-       COsmo4 *gpac = GetApp();
-       Bool force_rtsp = 0;
-       s32 sel = m_Port.GetCurSel();
-       switch (sel) {
-       case 3:
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "8080");
-               force_rtsp = 1;
-               break;
-       case 2:
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "80");
-               force_rtsp = 1;
-               break;
-       case 1:
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "7070");
-               break;
-       default:
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "DefaultPort", "554");
-               break;
-       }
-
-       if (force_rtsp) {
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTPoverRTSP", "yes");
-       } else {
-               gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTPoverRTSP", m_UseRTSP.GetCheck() ? "yes" : "no");
-               if (!m_UseRTSP.GetCheck()) gf_cfg_set_key(gpac->m_user.config, "Streaming", "ReorderSize", m_Reorder.GetCheck() ? "30" : "0");
-       }
-
-       TCHAR wstr[50];
-       char str[50];
-
-       m_Timeout.GetWindowText(wstr, 50);
-       CE_WideToChar((u16 *)wstr, str);
-       gf_cfg_set_key(gpac->m_user.config, "Streaming", "RTSPTimeout", str);
-
-       m_Buffer.GetWindowText(wstr, 50);
-       CE_WideToChar((u16 *)wstr, str);
-       gf_cfg_set_key(gpac->m_user.config, "Network", "BufferLength", str);
-       if (m_Rebuffer.GetCheck()) {
-               m_RebufferLen.GetWindowText(wstr, 50);
-               CE_WideToChar((u16 *)wstr, str);
-               gf_cfg_set_key(gpac->m_user.config, "Network", "RebufferLength", str);
-       } else {
-               gf_cfg_set_key(gpac->m_user.config, "Network", "RebufferLength", "0");
-       }
-}
-
-
-
-COptSystems::COptSystems(CWnd* pParent /*=NULL*/)
-       : CDialog(COptSystems::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(COptSystems)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void COptSystems::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(COptSystems)
-       DDX_Control(pDX, IDC_FORCE_DURATION, m_ForceDuration);
-       DDX_Control(pDX, IDC_DEC_THREAD, m_Threading);
-       DDX_Control(pDX, IDC_BIFSDROP, m_BifsAlwaysDrawn);
-       DDX_Control(pDX, IDC_LANG, m_Lang);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(COptSystems, CDialog)
-       //{{AFX_MSG_MAP(COptSystems)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COptSystems message handlers
-
-
-
-BOOL COptSystems::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       
-       COsmo4 *gpac = GetApp();
-       const char *sOpt;
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "Language3CC");
-       if (!sOpt) sOpt = "eng";
-       s32 select = 0;
-       while (m_Lang.GetCount()) m_Lang.DeleteString(0);
-       u32 i=0;
-       while (GF_ISO639_Lang[i]) {
-               TCHAR szTmp[100];
-               /*only use common languages (having both 2- and 3-char code names)*/
-               if (GF_ISO639_Lang[i+2][0]) {
-                       CE_CharToWide( (char *)GF_ISO639_Lang[i], (u16 *)szTmp);
-                       m_Lang.AddString(szTmp);
-                       if (sOpt && !stricmp(sOpt, GF_ISO639_Lang[i+1])) select = m_Lang.GetCount() - 1;
-               }
-               i+=3;
-       }
-       m_Lang.SetCurSel(select);
-
-       
-       /*system config*/
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "ThreadingPolicy");
-       select = 0;
-       while (m_Threading.GetCount()) m_Threading.DeleteString(0);
-       m_Threading.AddString(_T("Single Thread"));
-       m_Threading.AddString(_T("Mutli Thread"));
-       if (sOpt && !stricmp(sOpt, "Multi")) select = 1;
-       m_Threading.AddString(_T("Free"));
-       if (sOpt && !stricmp(sOpt, "Free")) select = 2;
-       m_Threading.SetCurSel(select);
-
-
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "ForceSingleClock");
-       if (sOpt && !stricmp(sOpt, "yes")) {
-               m_ForceDuration.SetCheck(1);
-       } else {
-               m_ForceDuration.SetCheck(0);
-       }
-       sOpt = gf_cfg_get_key(gpac->m_user.config, "Systems", "AlwaysDrawBIFS");
-       if (sOpt && !stricmp(sOpt, "yes")) {
-               m_BifsAlwaysDrawn.SetCheck(1);
-       } else {
-               m_BifsAlwaysDrawn.SetCheck(0);
-       }
-
-       
-       return TRUE; 
-}
-
-
-void COptSystems::SaveOptions()
-{
-       COsmo4 *gpac = GetApp();
-
-       s32 sel = m_Lang.GetCurSel();
-       u32 i=0;
-       while (GF_ISO639_Lang[i]) {
-               /*only use common languages (having both 2- and 3-char code names)*/
-               if (GF_ISO639_Lang[i+2][0]) {
-                       if (!sel) break;
-                       sel--;
-               }
-               i+=3;
-       }
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "LanguageName", GF_ISO639_Lang[i]);
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "Language3CC", GF_ISO639_Lang[i+1]);
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "Language2CC", GF_ISO639_Lang[i+2]);
-
-       sel = m_Threading.GetCurSel();
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "ThreadingPolicy", (sel==0) ? "Single" : ( (sel==1) ? "Multi" : "Free"));
-
-       /*reset duration flag*/
-       gpac->m_duration = (u32) -1;
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "ForceSingleClock", m_ForceDuration.GetCheck() ? "yes" : "no");
-       gf_cfg_set_key(gpac->m_user.config, "Systems", "AlwaysDrawBIFS", m_BifsAlwaysDrawn.GetCheck() ? "yes" : "no");
-
-}
-
diff --git a/applications/osmo4_wce/Options.h b/applications/osmo4_wce/Options.h
deleted file mode 100644 (file)
index 89abecd..0000000
+++ /dev/null
@@ -1,388 +0,0 @@
-#if !defined(AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_)
-#define AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// Options.h : header file
-//
-
-
-class COptSystems : public CDialog
-{
-// Construction
-public:
-       COptSystems(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptSystems)
-       enum { IDD = IDD_OPT_SYSTEMS };
-       CButton m_ForceDuration;
-       CComboBox       m_Threading;
-       CButton m_BifsAlwaysDrawn;
-       CComboBox       m_Lang;
-       //}}AFX_DATA
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptSystems)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptSystems)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-class COptStream : public CDialog
-{
-// Construction
-public:
-       COptStream(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptStream)
-       enum { IDD = IDD_OPT_STREAM };
-       CEdit   m_RebufferLen;
-       CButton m_Rebuffer;
-       CEdit   m_Buffer;
-       CEdit   m_Timeout;
-       CButton m_Reorder;
-       CButton m_UseRTSP;
-       CComboBox       m_Port;
-       //}}AFX_DATA
-
-
-       void SaveOptions();
-
-       void CheckRebuffer();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptStream)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptStream)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnSelchangePort();
-       afx_msg void OnRtsp();
-       afx_msg void OnRebuffer();
-       afx_msg void OnUpdateRebufferLen();
-       afx_msg void OnUpdateBuffer();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-class COptRender : public CDialog
-{
-// Construction
-public:
-       COptRender(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptRender)
-       enum { IDD = IDD_OPT_RENDER };
-       CComboBox       m_Antialias;
-       CButton m_ForceSize;
-       CButton m_HighSpeed;
-       CButton m_Scalable;
-       CButton m_DirectRender;
-       CComboBox       m_BIFSRate;
-       //}}AFX_DATA
-
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptRender)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptRender)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-class COptHTTP : public CDialog
-{
-// Construction
-public:
-       COptHTTP(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptHTTP)
-       enum { IDD = IDD_OPT_HTTP };
-       CButton m_RestartFile;
-       CButton m_Progressive;
-       CButton m_CleanCache;
-       CButton m_CacheDir;
-       CEdit   m_SaxDuration;
-       //}}AFX_DATA
-
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptHTTP)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptHTTP)
-       afx_msg void OnBrowseCache();
-       afx_msg void OnProgressive();
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-class COptGen : public CDialog
-{
-// Construction
-public:
-       COptGen(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptGen)
-       enum { IDD = IDD_OPT_GEN };
-       CButton m_NoBacklight;
-       CButton m_Fill;
-       CButton m_Loop;
-       CButton m_Logs;
-       //}}AFX_DATA
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptGen)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptGen)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnFileassoc();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-class COptFont : public CDialog
-{
-// Construction
-public:
-       COptFont(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptFont)
-       enum { IDD = IDD_OPT_FONT };
-       CButton m_UseTexture;
-       CComboBox       m_Fonts;
-       CButton m_BrowseFont;
-       //}}AFX_DATA
-
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptFont)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptFont)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnBrowseFont();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-class COptDecoder : public CDialog
-{
-// Construction
-public:
-       COptDecoder(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptDecoder)
-       enum { IDD = IDD_OPT_DECODER };
-       CComboBox       m_Video;
-       CComboBox       m_Audio;
-       //}}AFX_DATA
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptDecoder)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptDecoder)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-class COptAudio : public CDialog
-{
-// Construction
-public:
-       COptAudio(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptAudio)
-       enum { IDD = IDD_OPT_AUDIO };
-       CComboBox       m_DriverList;
-       CButton m_AudioResync;
-       CEdit   m_AudioDur;
-       CSpinButtonCtrl m_SpinDur;
-       CButton m_ForceConfig;
-       CSpinButtonCtrl m_AudioSpin;
-       CEdit   m_AudioEdit;
-       //}}AFX_DATA
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptAudio)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptAudio)
-       virtual BOOL OnInitDialog();
-       afx_msg void OnForceAudio();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-
-class COptRender3D : public CDialog
-{
-// Construction
-public:
-       COptRender3D(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptRender)
-       enum { IDD = IDD_OPT_RENDER3D };
-       CComboBox       m_WireMode;
-       CComboBox       m_DrawNormals;
-       CButton m_Use3DRender;
-       CButton m_NoBackFace;
-       CButton m_EmulatePOW2;
-       //}}AFX_DATA
-
-       void SaveOptions();
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptRender)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(COptRender)
-       virtual BOOL OnInitDialog();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// COptions dialog
-
-class COptions : public CDialog
-{
-// Construction
-public:
-       COptions(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(COptions)
-       enum { IDD = IDD_OPTIONS };
-       CComboBox       m_Selection;
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COptions)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       COptGen m_general;
-       COptSystems m_systems;
-       COptRender m_render;
-       COptRender3D m_render3D;
-       COptAudio m_audio;
-       COptHTTP m_http;
-       COptFont m_font;
-       COptStream m_stream;
-       COptDecoder m_decoder;
-
-
-       void HideAll();
-
-       // Generated message map functions
-       //{{AFX_MSG(COptions)
-       virtual BOOL OnInitDialog();
-       virtual void OnOK();
-       afx_msg void OnSaveopt();
-       afx_msg void OnSelchangeCombosel();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_OPTIONS_H__5C839953_58C0_4D9D_89CE_2820C7686C1B__INCLUDED_)
diff --git a/applications/osmo4_wce/Osmo4.cpp b/applications/osmo4_wce/Osmo4.cpp
deleted file mode 100644 (file)
index 664e158..0000000
+++ /dev/null
@@ -1,636 +0,0 @@
-// Osmo4.cpp : Defines the class behaviors for the application.
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-
-#include <gpac/options.h>
-#include <gpac/modules/service.h>
-#include "MainFrm.h"
-#include "OpenDlg.h"
-#include "Options.h"
-#include <gx.h>
-
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// COsmo4
-
-BEGIN_MESSAGE_MAP(COsmo4, CWinApp)
-       //{{AFX_MSG_MAP(COsmo4)
-       ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
-       ON_COMMAND(IDD_CONFIGURE, OnConfigure)
-       ON_COMMAND(ID_OPEN_FILE, OnOpenFile)
-       ON_COMMAND(ID_OPEN_URL, OnOpenUrl)
-       ON_COMMAND(ID_SHORTCUTS, OnShortcuts)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-
-
-
-
-Bool Osmo4CE_EventProc(void *priv, GF_Event *event)
-{
-       u32 dur;
-       COsmo4 *app = (COsmo4 *) priv;
-       CMainFrame *pFrame = (CMainFrame *) app->m_pMainWnd;
-       /*shutdown*/
-       if (!pFrame) return 0;
-
-       switch (event->type) {
-       case GF_EVENT_MESSAGE:
-               if (event->message.error!=GF_OK) {
-                       if (event->message.error<GF_OK) {
-                               pFrame->console_err = event->message.error;
-                               pFrame->console_message = event->message.message;
-                               pFrame->PostMessage(WM_CONSOLEMSG, 0, 0);
-                       }
-                       return 0;
-               }
-               if (1) return 0;
-               /*process user message*/
-               pFrame->console_err = GF_OK;
-               pFrame->console_message = event->message.message;
-               pFrame->PostMessage(WM_CONSOLEMSG, 0, 0);
-               break;
-       case GF_EVENT_SIZE:
-               break;
-       case GF_EVENT_SCENE_SIZE:
-               app->m_scene_width = event->size.width;
-               app->m_scene_height = event->size.height;
-               if (!pFrame->m_full_screen) 
-                       pFrame->PostMessage(WM_SETSIZE, event->size.width, event->size.height);
-               break;
-       case GF_EVENT_CONNECT:
-               app->m_open = event->connect.is_connected;
-               break;
-       case GF_EVENT_DURATION:
-               dur = (u32) (1000 * event->duration.duration);
-               if (dur<2000) dur = 0;
-               app->m_duration = dur;
-               app->m_can_seek = event->duration.can_seek && dur;
-               pFrame->m_progBar.m_range_invalidated = 1;
-               /*by default, don't display timing if not seekable and vice-versa*/
-               if (app->m_can_seek != pFrame->m_view_timing) {
-                       pFrame->m_view_timing = app->m_can_seek;
-                       if (!pFrame->m_full_screen) 
-                               pFrame->PostMessage(WM_SETSIZE, 0, 0);
-               }
-               break;
-       case GF_EVENT_NAVIGATE:
-               /*store URL since it may be destroyed, and post message*/
-               app->m_navigate_url = event->navigate.to_url;
-               pFrame->PostMessage(WM_NAVIGATE, NULL, NULL);
-               return 1;
-       case GF_EVENT_QUIT:
-               pFrame->PostMessage(WM_CLOSE, 0L, 0L);
-               break;
-       /*ipaq keys*/
-       case GF_EVENT_KEYDOWN:
-               switch (event->key.key_code) {
-               case GF_KEY_F1: 
-                       pFrame->PostMessage(WM_COMMAND, ID_FILE_OPEN); 
-                       break;
-               case GF_KEY_F2:
-                       pFrame->PostMessage(WM_QUIT); 
-                       break;
-               case GF_KEY_F3:
-                       pFrame->PostMessage(WM_COMMAND, ID_FILE_RESTART);
-                       break;
-               case GF_KEY_F5:
-                       pFrame->PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN);
-                       break;
-               case GF_KEY_ENTER:
-                       pFrame->PostMessage(WM_COMMAND, ID_FILE_PAUSE);
-                       break;
-               case GF_KEY_LEFT:
-                       if (app->m_duration>=2000) {
-                               s32 res = gf_term_get_time_in_ms(app->m_term) - 5*app->m_duration/100;
-                               if (res<0) res=0;
-                               gf_term_play_from_time(app->m_term, res, 0);
-                       }
-                       break;
-               case GF_KEY_RIGHT:
-                       if (app->m_duration>=2000) {
-                               u32 res = gf_term_get_time_in_ms(app->m_term) + 5*app->m_duration/100;
-                               if (res>=app->m_duration) res = 0;
-                               gf_term_play_from_time(app->m_term, res, 0);
-                       }
-                       break;
-               case GF_KEY_UP:
-                       if (app->m_duration>=2000) pFrame->PostMessage(WM_COMMAND, ID_FILE_STEP);       
-                       break;
-               case GF_KEY_DOWN:
-                       gf_term_set_option(app->m_term, GF_OPT_REFRESH, 0);
-                       break;
-               }
-               break;
-       case GF_EVENT_DBLCLICK:
-               pFrame->PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN);
-               return 0;
-       }
-       
-       return 0;
-}
-
-COsmo4::COsmo4()
-       : CWinApp()
-{
-       // TODO: add construction code here,
-       // Place all significant initialization in InitInstance
-       m_logs = NULL;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// The one and only COsmo4 object
-
-COsmo4 theApp;
-
-static void osmo4_do_log(void *cbk, u32 level, u32 tool, const char *fmt, va_list list)
-{
-       FILE *logs = (FILE *) cbk;
-       if (logs) {
-           vfprintf(logs, fmt, list);
-               fflush(logs);
-       }
-}
-
-void COsmo4::EnableLogs(Bool turn_on)
-{
-       if (turn_on) {
-               m_logs = fopen("\\gpac_logs.txt", "wt");
-               if (!m_logs) {
-                       MessageBox(NULL, _T("Couldn't open log files at file system root"), _T("Disabling logs"), MB_OK);
-                       turn_on = 0;
-               } else {
-                       gf_log_set_level(GF_LOG_DEBUG);
-//                     gf_log_set_tools(0xFFFFFFFF);
-                       gf_log_set_tools(GF_LOG_CORE|GF_LOG_NETWORK|GF_LOG_RTP|GF_LOG_SYNC|GF_LOG_CODEC|GF_LOG_MEDIA);
-                       gf_log_set_callback(m_logs, osmo4_do_log);
-                       gf_cfg_set_key(m_user.config, "General", "LogLevel", "debug");
-               }
-       } 
-       if (!turn_on) {
-               if (m_logs) {
-                       fclose(m_logs);
-                       m_logs = 0;
-               }
-               gf_log_set_level(0);
-               gf_log_set_tools(0);
-               gf_log_set_callback(NULL, NULL);
-               gf_cfg_set_key(m_user.config, "General", "LogLevel", "none");
-       }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// COsmo4 initialization
-
-BOOL COsmo4::InitInstance()
-{
-       Bool first_load = 0;
-       if (!AfxSocketInit())
-       {
-               AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
-               return FALSE;
-       }
-
-       gf_sys_init();
-       
-       SetRegistryKey(_T("GPAC"));
-
-       m_prev_batt_bl = m_prev_ac_bl = 0;
-
-       m_screen_width = GetSystemMetrics(SM_CXSCREEN);
-       m_screen_height = GetSystemMetrics(SM_CYSCREEN);
-       m_menu_height = GetSystemMetrics(SM_CYMENU);
-       m_scene_width = m_scene_height = 0;
-
-       CMainFrame* pFrame = new CMainFrame;
-       m_pMainWnd = pFrame;
-
-       pFrame->LoadFrame(IDR_MAINFRAME, WS_VISIBLE, NULL, NULL);
-
-       pFrame->ShowWindow(m_nCmdShow);
-       pFrame->UpdateWindow();
-
-       TCHAR w_config_path[MAX_PATH];
-       char config_path[MAX_PATH];
-       GetModuleFileName(NULL, w_config_path, MAX_PATH);
-       CE_WideToChar((u16 *) w_config_path, (char *) config_path);
-
-       while (config_path[strlen((char *) config_path)-1] != '\\') config_path[strlen((char *) config_path)-1] = 0;
-
-       /*setup user*/
-       memset(&m_user, 0, sizeof(GF_User));
-
-       /*init config and plugins*/
-       m_user.config = gf_cfg_init(NULL, &first_load);
-       if (!m_user.config) {
-               MessageBox(NULL, _T("GPAC Configuration file not found"), _T("Fatal Error"), MB_OK);
-               m_pMainWnd->PostMessage(WM_CLOSE);
-       }
-
-       const char *str = gf_cfg_get_key(m_user.config, "General", "LogLevel");
-       EnableLogs((str && !strcmp(str, "debug")) ? 1 : 0);
-
-       if (first_load) {
-               /*first launch, register all files ext*/
-               u32 i;
-               for (i=0; i<gf_modules_get_count(m_user.modules); i++) {
-                       GF_InputService *ifce = (GF_InputService *) gf_modules_load_interface(m_user.modules, i, GF_NET_CLIENT_INTERFACE);
-                       if (!ifce) continue;
-                       if (ifce) {
-                               ifce->CanHandleURL(ifce, "test.test");
-                               gf_modules_close_interface((GF_BaseInterface *)ifce);
-                       }
-               }
-               ::MessageBox(NULL, _T("Osmo4/GPAC Setup complete"), _T("Initial launch"), MB_OK);
-       }
-
-
-       str = gf_cfg_get_key(m_user.config, "General", "ModulesDirectory");
-       m_user.modules = gf_modules_new(str, m_user.config);
-       if (!m_user.modules || ! gf_modules_get_count(m_user.modules) ) {
-               MessageBox(NULL, _T("No plugins available - system cannot work"), _T("Fatal Error"), MB_OK);
-               m_pMainWnd->PostMessage(WM_QUIT);
-               return FALSE;
-       }
-
-       m_user.config = m_user.config;
-       m_user.modules = m_user.modules;
-       m_user.EventProc = Osmo4CE_EventProc;
-       m_user.opaque = this;
-       m_user.os_window_handler = pFrame->m_wndView.m_hWnd;
-
-
-       m_term = gf_term_new(&m_user);
-       if (! m_term) {
-               MessageBox(NULL, _T("Cannot load MPEG-4 Terminal"), _T("Fatal Error"), MB_OK);
-               m_pMainWnd->PostMessage(WM_QUIT);
-       }
-
-       m_stopped = 0;
-       m_open = 0;
-       m_can_seek = 0;
-       m_DoResume = 0;
-       SetOptions();
-       pFrame->SendMessage(WM_SETSIZE, 0, 0);
-       ShowTaskBar(0);
-
-       CCommandLineInfo cmdInfo;
-       ParseCommandLine(cmdInfo);
-
-       if (! cmdInfo.m_strFileName.IsEmpty()) {
-               m_filename = cmdInfo.m_strFileName;
-               m_pMainWnd->PostMessage(WM_OPENURL);
-       } else {
-               str = gf_cfg_get_key(m_user.config, "General", "StartupFile");
-               if (str) gf_term_connect(m_term, str);
-       }
-       return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// COsmo4 message handlers
-
-
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CAboutDlg dialog used for App About
-
-class CAboutDlg : public CDialog
-{
-public:
-       CAboutDlg();
-
-// Dialog Data
-       //{{AFX_DATA(CAboutDlg)
-       enum { IDD = IDD_ABOUTBOX };
-       CStatic m_AbtTxt;
-       //}}AFX_DATA
-
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CAboutDlg)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-       //{{AFX_MSG(CAboutDlg)
-       virtual BOOL OnInitDialog();            // Added for WCE apps
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
-{
-       //{{AFX_DATA_INIT(CAboutDlg)
-       //}}AFX_DATA_INIT
-}
-
-void CAboutDlg::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(CAboutDlg)
-       DDX_Control(pDX, IDC_ABT_TEXT, m_AbtTxt);
-       //}}AFX_DATA_MAP
-}
-
-BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
-       //{{AFX_MSG_MAP(CAboutDlg)
-               // No message handlers
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// COsmo4 commands
-// Added for WCE apps
-
-BOOL CAboutDlg::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-       CString str = _T("Osmo4 Player\nGPAC V");
-       str += _T(GPAC_VERSION);
-       str += _T(" (build");
-       str += _T(GPAC_BUILD_NUMBER);
-       str += _T(")");
-       m_AbtTxt.SetWindowText(str);
-       return TRUE; 
-}
-
-
-
-void COsmo4::OnAppAbout()
-{
-       CAboutDlg aboutDlg;
-       ShowTaskBar(1);
-       aboutDlg.DoModal();
-       ShowTaskBar(0);
-}
-
-
-int COsmo4::ExitInstance() 
-{
-       gf_term_del(m_term);
-       gf_modules_del(m_user.modules);
-       gf_cfg_del(m_user.config);
-       ShowTaskBar(1);
-       gf_sys_close();
-       if (m_logs) fclose(m_logs);
-       return CWinApp::ExitInstance();
-}
-
-void COsmo4::SetOptions()
-{
-       const char *sOpt = gf_cfg_get_key(m_user.config, "General", "Loop");
-       m_Loop = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
-       sOpt = gf_cfg_get_key(m_user.config, "General", "FillScreen");
-       m_fit_screen = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
-       sOpt = gf_cfg_get_key(m_user.config, "General", "DisableBackLight");
-       m_disable_backlight = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
-       gf_term_set_option(m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);
-       sOpt = gf_cfg_get_key(m_user.config, "General", "NoMIMETypeFetch");
-       m_no_mime_fetch = (!sOpt || !stricmp(sOpt, "yes")) ? 1 : 0;
-
-       //gf_term_set_option(m_term, GF_OPT_AUDIO_VOLUME, 100);
-}
-
-void COsmo4::Pause()
-{
-       if (!m_open) return;
-
-       if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
-               gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
-               SetBacklightState(0);
-       } else {
-               gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
-               SetBacklightState(1);
-       }
-       ((CMainFrame*)m_pMainWnd)->SetPauseButton();
-}
-
-
-void COsmo4::OnConfigure()
-{
-       COptions dlg;
-       
-       ShowTaskBar(1);
-       dlg.DoModal();
-       ShowTaskBar(0);
-}
-
-void COsmo4::ShowTaskBar(Bool showIt, Bool pause_only)
-{
-       if (showIt) {
-               m_DoResume = 0;
-               if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
-                       m_DoResume = 1;
-                       gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
-               }
-               gf_term_set_option(m_term, GF_OPT_FREEZE_DISPLAY, 1);
-               if (!pause_only) {
-                       SHFullScreen(GetForegroundWindow(), SHFS_HIDESTARTICON | SHFS_SHOWTASKBAR| SHFS_SHOWSIPBUTTON);
-                       ::ShowWindow(::FindWindow(_T("HHTaskbar"),NULL), SW_SHOWNA);
-               }
-               SetBacklightState(0);
-       } else {
-               if (!pause_only) {
-                       SHFullScreen(GetForegroundWindow(), SHFS_HIDESTARTICON | SHFS_HIDETASKBAR| SHFS_HIDESIPBUTTON);
-                       ::ShowWindow(::FindWindow(_T("HHTaskbar"),NULL), SW_HIDE);
-               }
-               gf_term_set_option(m_term, GF_OPT_FREEZE_DISPLAY, 0);
-               gf_term_set_option(m_term, GF_OPT_REFRESH, 0);
-               if (m_DoResume) {
-                       gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
-                       SetBacklightState(1);
-                       m_DoResume = 0;
-               }
-               m_pMainWnd->SetFocus();
-       }
-}
-
-
-CString COsmo4::GetFileFilter()
-{
-       u32 keyCount, i;
-       CString sFiles;
-       CString sExts;
-       CString supportedFiles;
-
-       return CString("All Files |*.*|");
-
-       supportedFiles = "All Known Files|*.m3u;*.pls";
-
-       sExts = "";
-       sFiles = "";
-       keyCount = gf_cfg_get_key_count(m_user.config, "MimeTypes");
-       for (i=0; i<keyCount; i++) {
-               const char *sMime;
-               Bool first;
-               char *sKey;
-               char szKeyList[1000], sDesc[1000];
-               short swKeyList[1000], swDesc[1000];
-               sMime = gf_cfg_get_key_name(m_user.config, "MimeTypes", i);
-               if (!sMime) continue;
-               CString sOpt;
-               const char *opt = gf_cfg_get_key(m_user.config, "MimeTypes", sMime);
-               /*remove #include <gpac/options.h>
- name*/
-               strcpy(szKeyList, opt+1);
-               sKey = strrchr(szKeyList, '\"');
-               if (!sKey) continue;
-               sKey[0] = 0;
-               /*get description*/
-               sKey = strrchr(szKeyList, '\"');
-               if (!sKey) continue;
-               strcpy(sDesc, sKey+1);
-               sKey[0] = 0;
-               sKey = strrchr(szKeyList, '\"');
-               if (!sKey) continue;
-               sKey[0] = 0;
-
-               CE_CharToWide(sDesc, (unsigned short *)swDesc);
-               CE_CharToWide(szKeyList, (unsigned short *)swKeyList);
-
-               /*if same description for # mime types skip (means an old mime syntax)*/
-               if (sFiles.Find((LPCTSTR) swDesc)>=0) continue;
-               /*if same extensions for # mime types skip (don't polluate the file list)*/
-               if (sExts.Find((LPCTSTR) swKeyList)>=0) continue;
-
-               sExts += (LPCTSTR) swKeyList;
-               sExts += " ";
-               sFiles += (LPCTSTR) swDesc;
-               sFiles += "|";
-
-               first = 1;
-
-               sOpt = CString(szKeyList);
-               while (1) {
-                       
-                       int pos = sOpt.Find(' ');
-                       CString ext = (pos==-1) ? sOpt : sOpt.Left(pos);
-                       /*WATCHOUT: we do have some "double" ext , eg .wrl.gz - these are NOT supported by windows*/
-                       if (ext.Find(_T("."))<0) {
-                               if (!first) {
-                                       sFiles += ";";
-                               } else {
-                                       first = 0;
-                               }
-                               sFiles += "*.";
-                               sFiles += ext;
-
-                               CString sext = ext;
-                               sext += ";";
-                               if (supportedFiles.Find(sext)<0) {
-                                       supportedFiles += ";*.";
-                                       supportedFiles += ext;
-                               }
-                       }
-
-                       if (sOpt==ext) break;
-                       CString rem;
-                       rem.Format(_T("%s "), (LPCTSTR) ext);
-                       sOpt.Replace((LPCTSTR) rem, _T(""));
-               }
-               sFiles += "|";
-       }
-       supportedFiles += "|";
-       supportedFiles += sFiles;
-       //supportedFiles += "M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|All Files |*.*|";
-       supportedFiles += "All Files |*.*|";
-       return supportedFiles;
-}
-
-void COsmo4::OnOpenFile() 
-{
-       Bool res;
-       CFileDialog fd(TRUE,NULL,_T("\\"),OFN_HIDEREADONLY, GetFileFilter());
-
-       ShowTaskBar(1);
-       res = 0;
-       if (fd.DoModal()==IDOK) {
-               res = 1;
-               m_filename = fd.GetPathName();
-               m_DoResume = 0;/*done by term*/
-       } 
-       ShowTaskBar(0);
-       if (res) m_pMainWnd->PostMessage(WM_OPENURL);
-}
-
-void COsmo4::OnOpenUrl() 
-{
-       OpenDlg dlg;
-       Bool res;
-       ShowTaskBar(1, 1);
-       res = 0;
-       if (dlg.DoModal() == IDOK) {
-               res = 1;
-               m_DoResume = 0;/*done by term*/
-       } 
-       ShowTaskBar(0, 1);
-       if (res) m_pMainWnd->PostMessage(WM_OPENURL);
-}
-
-void COsmo4::SetBacklightState(Bool disable) 
-{
-       HKEY hKey = 0;
-       DWORD dwSize;
-       DWORD dwValue;
-       HANDLE hBL;
-
-       if (!m_disable_backlight) return;
-
-       if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("ControlPanel\\Backlight"), 0, 0, &hKey ) != ERROR_SUCCESS) return;
-
-       if (disable) {
-               dwSize = 4;
-               RegQueryValueEx(hKey, _T("BatteryTimeout"), NULL, NULL,(unsigned char*) &m_prev_batt_bl, &dwSize);
-               dwSize = 4;
-               RegQueryValueEx(hKey, _T("ACTimeout"), NULL, NULL, (unsigned char*) &m_prev_ac_bl,&dwSize);
-               dwSize = 4;
-               dwValue = 0xefff ;
-               RegSetValueEx(hKey, _T("BatteryTimeout"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
-               dwSize = 4;
-               dwValue = 0xefff ;
-               RegSetValueEx( hKey, _T("ACTimeout"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
-       } else {
-               if (m_prev_batt_bl) {
-                       dwSize = 4;
-                       RegSetValueEx(hKey, _T("BatteryTimeout"), NULL, REG_DWORD, (unsigned char *)&m_prev_batt_bl, dwSize);
-               }
-               if (m_prev_ac_bl) {
-                       dwSize = 4;
-                       RegSetValueEx(hKey, _T("ACTimeout"), NULL, REG_DWORD,(unsigned char *)&m_prev_ac_bl, dwSize);
-               }
-       }
-       RegCloseKey(hKey);
-       hBL = CreateEvent(NULL, FALSE, FALSE, _T("BackLightChangeEvent"));
-       if (hBL) {
-               SetEvent(hBL);
-               CloseHandle(hBL);
-       }
-}
-
-void COsmo4::OnShortcuts() 
-{
-       ShowTaskBar(1);
-
-       MessageBox(NULL,
-               _T("Double Click: Fullscreen on/off\n"),
-
-               _T("Osmo4 Shortcuts"),
-               MB_OK);
-       
-       ShowTaskBar(0);
-}
-
diff --git a/applications/osmo4_wce/Osmo4.h b/applications/osmo4_wce/Osmo4.h
deleted file mode 100644 (file)
index c063de6..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-// Osmo4.h : main header file for the OSMO4 application
-//
-
-#if !defined(AFX_OSMO4_H__7E4A02D1_F77D_4E97_9E10_032054B29E33__INCLUDED_)
-#define AFX_OSMO4_H__7E4A02D1_F77D_4E97_9E10_032054B29E33__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-#ifndef __AFXWIN_H__
-       #error include 'stdafx.h' before including this file for PCH
-#endif
-
-#include "resource.h"       // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// COsmo4:
-// See Osmo4.cpp for the implementation of this class
-//
-
-/*MPEG4 term*/
-#include <gpac/terminal.h>
-
-enum {
-       WM_SCENE_DONE = WM_USER + 1, 
-       WM_NAVIGATE,
-       WM_SETSIZE,
-       WM_OPENURL,
-       WM_CONSOLEMSG,
-};
-
-
-#define IPAQ_TRANSLATE_KEY(vk) (LOWORD(vk) != 0x5b ? LOWORD(vk) : vk )
-/*navigation pad keys*/
-#define VK_IPAQ_LEFT           0x25
-#define VK_IPAQ_UP                     0x26
-#define VK_IPAQ_RIGHT          0x27
-#define VK_IPAQ_DOWN           0x28
-/*"enter" key*/
-#define VK_IPAQ_START          0x86
-/*ipaq keys from left to right*/
-#define VK_IPAQ_A                      0xC1
-#define VK_IPAQ_B                      0xC2
-#define VK_IPAQ_C                      0xC3
-#define VK_IPAQ_D                      0xC4
-/*record button*/
-#define VK_IPAQ_E                      0xC5
-
-class COsmo4 : public CWinApp
-{
-public:
-       COsmo4();
-
-       GF_Terminal *m_term;
-       GF_User m_user;
-       CString m_filename;
-
-       u32 m_duration;
-       CString m_navigate_url;
-       Bool m_Loop, m_fit_screen, m_can_seek, m_open, m_disable_backlight, m_stopped, m_no_mime_fetch;
-       void Pause();
-
-       u32 m_scene_width, m_scene_height, m_reconnect_time;
-       u32 m_screen_width, m_screen_height, m_menu_height;
-       /*task bar on/off*/
-       void ShowTaskBar(Bool showIt, Bool pause_only = 0);
-
-       CString GetFileFilter();
-
-       void SetBacklightState(Bool disable);
-       void EnableLogs(Bool turn_on);
-
-private:
-       Bool m_DoResume;
-
-       void SetOptions();
-
-       /*power management*/
-       u32 m_prev_batt_bl, m_prev_ac_bl;
-
-       FILE *m_logs;
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(COsmo4)
-       public:
-       virtual BOOL InitInstance();
-       virtual int ExitInstance();
-       //}}AFX_VIRTUAL
-
-// Implementation
-
-       //{{AFX_MSG(COsmo4)
-       afx_msg void OnAppAbout();
-       afx_msg void OnConfigure();
-       afx_msg void OnOpenFile();
-       afx_msg void OnOpenUrl();
-       afx_msg void OnShortcuts();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-inline COsmo4 *GetApp() { return (COsmo4 *)AfxGetApp(); }
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_OSMO4_H__7E4A02D1_F77D_4E97_9E10_032054B29E33__INCLUDED_)
diff --git a/applications/osmo4_wce/Osmo4.rc b/applications/osmo4_wce/Osmo4.rc
deleted file mode 100644 (file)
index 487a60a..0000000
+++ /dev/null
@@ -1,756 +0,0 @@
-//Microsoft eMbedded Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-#include "newres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDR_MAINFRAME           ICON    DISCARDABLE     "res\\Osmo4.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDR_MAINFRAME           BITMAP  MOVEABLE PURE   "res\\Cmdbar.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Toolbar
-//
-
-IDR_MAINFRAME TOOLBAR DISCARDABLE  16, 16
-BEGIN
-    BUTTON      ID_OPEN_FILE
-    BUTTON      ID_FILE_PAUSE
-    BUTTON      ID_FILE_STEP
-    BUTTON      ID_FILE_STOP
-    BUTTON      ID_VIEW_FULLSCREEN
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE 
-BEGIN
-    "O",            ID_FILE_OPEN,           VIRTKEY, CONTROL, NOINVERT
-    "Q",            ID_APP_EXIT,            VIRTKEY, CONTROL, NOINVERT
-    "S",            ID_FILE_SAVE,           VIRTKEY, CONTROL, NOINVERT
-    "V",            ID_EDIT_PASTE,          VIRTKEY, CONTROL, NOINVERT
-    "X",            ID_EDIT_CUT,            VIRTKEY, CONTROL, NOINVERT
-    "Z",            ID_EDIT_UNDO,           VIRTKEY, CONTROL, NOINVERT
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOG DISCARDABLE  0, 0, 140, 153
-STYLE WS_POPUP | WS_CAPTION
-EXSTYLE 0x80000000L
-CAPTION "About Osmo4"
-FONT 8, "System"
-BEGIN
-    ICON            IDR_MAINFRAME,IDC_STATIC,15,3,21,20
-    CTEXT           "Osmo4 player\nGPAC MPEG-4 SDK",IDC_ABT_TEXT,44,4,64,17
-    CTEXT           "This program is free software and may be distributed according to the terms of the GNU Lesser General Public License",
-                    IDC_STATIC,3,24,131,24
-    CTEXT           "GPAC Copyright (C) 2000 - 2005 by Jean Le Feuvre All Rights Reserved http://gpac.sourceforge.net",
-                    IDC_STATIC,4,52,129,26
-    LTEXT           "GPAC (Osmo4 (C) 2002-2005)",IDC_STATIC,11,100,109,8
-    LTEXT           "Mozilla SpiderMonkey (JavaScript)",IDC_STATIC,11,110,
-                    109,8
-    LTEXT           "The FreeType Project",IDC_STATIC,11,120,70,8
-    LTEXT           "The PNG Group, The I.J.G.",IDC_STATIC,12,130,87,8
-    LTEXT           "XVID, FAAD, MAD, 3GPP",IDC_STATIC,13,139,80,8
-    LTEXT           "------------ With many thanks to: -------------",
-                    IDC_STATIC,0,91,139,8
-END
-
-IDD_OPENFILE DIALOG DISCARDABLE  0, 0, 133, 116
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Select file location"
-FONT 8, "System"
-BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,92,33,27,14
-    COMBOBOX        IDC_FILELIST,4,17,127,52,CBS_DROPDOWN | CBS_AUTOHSCROLL | 
-                    CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
-    DEFPUSHBUTTON   "Cancel",IDCANCEL,14,34,27,14
-    LTEXT           "Enter path to remote file",IDC_STATIC,25,6,80,8
-END
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040904b0"
-        BEGIN
-            VALUE "Comments", "\0"
-            VALUE "CompanyName", "\0"
-            VALUE "FileDescription", "Osmo4-GPAC\0"
-            VALUE "FileVersion", "0.4.5\0"
-            VALUE "InternalName", "Osmo4\0"
-            VALUE "LegalCopyright", "Copyright (C) ENST 2005-2007\0"
-            VALUE "LegalTrademarks", "\0"
-            VALUE "OriginalFilename", "Osmo4.EXE\0"
-            VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "Osmo4-0.4.5\0"
-            VALUE "ProductVersion", "0.4.5\0"
-            VALUE "SpecialBuild", "\0"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x409, 1200
-    END
-END
-
-#endif    // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE 
-BEGIN
-    IDD_ABOUTBOX, DIALOG
-    BEGIN
-        RIGHTMARGIN, 138
-        TOPMARGIN, 1
-    END
-
-    IDD_OPENFILE, DIALOG
-    BEGIN
-        LEFTMARGIN, 2
-        TOPMARGIN, 2
-        BOTTOMMARGIN, 113
-    END
-END
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menubar
-//
-
-IDR_MENU MENU DISCARDABLE 
-BEGIN
-    POPUP "File"
-    BEGIN
-        MENUITEM "Open",                        ID_OPEN_FILE
-        MENUITEM "Open URL",                    ID_OPEN_URL
-        MENUITEM SEPARATOR
-        MENUITEM "Exit",                        ID_APP_EXIT
-    END
-    POPUP "View"
-    BEGIN
-        POPUP "Viewpoint"
-        BEGIN
-            MENUITEM "",                            ID_VIEWPORT_EMPTY
-        END
-        POPUP "Navigation"
-        BEGIN
-            MENUITEM "Reset",                       ID_NAV_RESET
-            MENUITEM SEPARATOR
-            MENUITEM "None",                        ID_NAV_NONE
-            MENUITEM "Walk",                        ID_NAV_WALK
-            MENUITEM "Fly",                         ID_NAV_FLY
-            MENUITEM "Examine",                     ID_NAV_EXAMINE
-            MENUITEM "Slide",                       ID_NAV_SLIDE
-            MENUITEM SEPARATOR
-            MENUITEM "Headlight",                   ID_NAV_HEADLIGHT
-            MENUITEM "Gravity",                     ID_NAV_GRAVITY
-            POPUP "Collision"
-            BEGIN
-                MENUITEM "Off",                         ID_COLLIDE_OFF
-                MENUITEM "Regular",                     ID_COLLIDE_REG
-                MENUITEM "Displacement",                ID_COLLIDE_DISP
-            END
-        END
-        MENUITEM SEPARATOR
-        MENUITEM "Fullscreen",                  ID_VIEW_FULLSCREEN
-        POPUP "Aspect Ratio"
-        BEGIN
-            MENUITEM "Keep Original",               ID_VIEW_AR_ORIG
-            MENUITEM "Fill Screen",                 ID_VIEW_AR_FILL
-            MENUITEM "Ratio 4/3",                   ID_VIEW_AR_43
-            MENUITEM "Ratio 16/9",                  ID_VIEW_AR_169
-            MENUITEM SEPARATOR
-            MENUITEM "Fit Screen",                  ID_VIEW_FIT
-        END
-        MENUITEM SEPARATOR
-        MENUITEM "Time Control",                ID_VIEW_TIMING
-        MENUITEM SEPARATOR
-        MENUITEM "Settings",                    IDD_CONFIGURE
-    END
-    POPUP "?"
-    BEGIN
-        MENUITEM "Shortcuts",                   ID_SHORTCUTS
-        MENUITEM "About ...",                   ID_APP_ABOUT
-    END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Data
-//
-
-IDR_MENU SHMENUBAR DISCARDABLE 
-BEGIN
-    IDR_MENU, 3,
-    I_IMAGENONE, ID_FILE, TBSTATE_ENABLED, 
-    TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_FILE, 0, 0,
-    I_IMAGENONE, ID_VIEW, TBSTATE_ENABLED, 
-    TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_VIEW, 0, 1,
-    I_IMAGENONE, ID_MENUITEM32789, TBSTATE_ENABLED, 
-    TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_MENUITEM32790, 0, 2,
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_EDIT                "File"
-    IDS_TOOL                "Tools"
-    IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
-END
-
-STRINGTABLE PRELOAD DISCARDABLE 
-BEGIN
-    IDR_MAINFRAME           "Osmo4\n\nOsmo4\n\n\nOsmo4.Document\nOsmo4 Document"
-END
-
-STRINGTABLE PRELOAD DISCARDABLE 
-BEGIN
-    AFX_IDS_IDLEMESSAGE     "Ready"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_FILE_SAVE_AS         "Save the active document with a new name\nSave As"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_APP_ABOUT            "Display program information, version number and copyright\nAbout"
-    ID_APP_EXIT             "Quit the application; prompts to save documents\nExit"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_NEXT_PANE            "Switch to the next window pane\nNext Pane"
-    ID_PREV_PANE            "Switch back to the previous window pane\nPrevious Pane"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_WINDOW_SPLIT         "Split the active window into panes\nSplit"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_EDIT_CLEAR           "Erase the selection\nErase"
-    ID_EDIT_CLEAR_ALL       "Erase everything\nErase All"
-    ID_EDIT_COPY            "Copy the selection and put it on the Clipboard\nCopy"
-    ID_EDIT_CUT             "Cut the selection and put it on the Clipboard\nCut"
-    ID_EDIT_FIND            "Find the specified text\nFind"
-    ID_EDIT_PASTE           "Insert Clipboard contents\nPaste"
-    ID_EDIT_REPEAT          "Repeat the last action\nRepeat"
-    ID_EDIT_REPLACE         "Replace specific text with different text\nReplace"
-    ID_EDIT_SELECT_ALL      "Select the entire document\nSelect All"
-    ID_EDIT_UNDO            "Undo the last action\nUndo"
-    ID_EDIT_REDO            "Redo the previously undone action\nRedo"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    AFX_IDS_SCCLOSE         "Close the active window and prompts to save the documents"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    AFX_IDS_SCTASKLIST      "Activate Task List"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_NEW                 "New"
-    IDS_FILE                "File"
-    IDS_MHELP               "Help"
-    IDS_SAVE                "Save"
-    IDS_CUT                 "Cut"
-    IDS_COPY                "Copy"
-    IDS_PASTE               "Paste"
-    IDS_ABOUT               "About"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_INDICATOR_CAPS       "CAP"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_CAP_FILE            "File"
-    ID_FILE_RESTART         "Restart presentation"
-    IDS_CAP_MENUITEM32790   "?"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_CAP_VIEW            "View"
-END
-
-#endif    // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// French (France) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
-#ifdef _WIN32
-LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_CONTROL DIALOG DISCARDABLE  0, 0, 161, 15
-STYLE DS_SETFOREGROUND | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_STATICEDGE
-FONT 8, "System"
-BEGIN
-    CONTROL         "Slider1",IDC_SLIDER,"msctls_trackbar32",TBS_BOTH | 
-                    TBS_NOTICKS | WS_TABSTOP,0,1,101,12
-    LTEXT           "00:00 FPS 30.00",IDC_TIME,102,3,56,10
-END
-
-IDD_OPTIONS DIALOG DISCARDABLE  0, 0, 134, 121
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Osmo4 Options"
-FONT 8, "System"
-BEGIN
-    PUSHBUTTON      "Apply",IDC_SAVEOPT,108,3,24,14
-    COMBOBOX        IDC_COMBOSEL,3,5,99,80,CBS_DROPDOWNLIST | WS_VSCROLL | 
-                    WS_TABSTOP
-    LTEXT           "-------------------------------------------------------",
-                    IDC_STATIC,0,17,133,8
-END
-
-IDD_OPT_GEN DIALOG DISCARDABLE  0, 120, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
-    CONTROL         "Loop at end",IDC_LOOP,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,6,28,54,10
-    PUSHBUTTON      "Make Default MPEG-4 Player",IDC_FILEASSOC,5,90,124,20,
-                    BS_MULTILINE
-    CONTROL         "Stretch display to fill screen",IDC_FILL_SCREEN,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,6,45,104,10
-    CONTROL         "Disable Backlight while playing",IDC_NO_BACKLIGHT,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,61,111,10
-    CONTROL         "Enable logs",IDC_ENABLE_LOGS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,6,74,52,10
-END
-
-IDD_OPT_RENDER DIALOG DISCARDABLE  0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
-    LTEXT           "Rendering Frame Rate",IDC_STATIC,27,27,73,8
-    COMBOBOX        IDC_BIFS_RATE,29,39,68,47,CBS_DROPDOWNLIST | WS_VSCROLL | 
-                    WS_TABSTOP
-    CONTROL         "Direct Rendering",IDC_DIRECTRENDER,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,1,64,69,10
-    CONTROL         "Scalable Zoom",IDC_ZOOM_SCALABLE,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,70,64,61,10
-    CONTROL         "Fast Rendering",IDC_FAST_RENDER,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,70,79,60,10
-    CONTROL         "Force Scene Size",IDC_FORCE_SIZE,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,1,79,70,10
-    LTEXT           "Anti-Aliasing",IDC_STATIC,6,103,40,8
-    COMBOBOX        IDC_AA_LIST,56,99,71,47,CBS_DROPDOWNLIST | WS_VSCROLL | 
-                    WS_TABSTOP
-END
-
-IDD_OPT_SYSTEMS DIALOG DISCARDABLE  0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
-    LTEXT           "Prefered Language for stream selection",IDC_STATIC,3,46,
-                    64,19
-    COMBOBOX        IDC_LANG,69,48,60,72,CBS_DROPDOWNLIST | WS_VSCROLL | 
-                    WS_TABSTOP
-    LTEXT           "Decoder Threading",IDC_STATIC,4,75,62,8
-    COMBOBOX        IDC_DEC_THREAD,69,72,60,30,CBS_DROPDOWNLIST | WS_VSCROLL | 
-                    WS_TABSTOP
-    CONTROL         "Always draw late BIFS frames",IDC_BIFSDROP,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,4,91,111,10
-    CONTROL         "Force Single Timeline",IDC_FORCE_DURATION,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,4,106,82,10
-END
-
-IDD_OPT_VIDEO DIALOG DISCARDABLE  0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
-    LTEXT           "Graphics Driver",IDC_STATIC,5,54,50,8
-    LTEXT           "Anti-Aliasing",IDC_STATIC,6,77,40,8
-    LTEXT           "Video Driver",IDC_STATIC,5,98,40,8
-    COMBOBOX        IDC_GD_LIST,56,53,71,30,CBS_DROPDOWNLIST | CBS_SORT | 
-                    WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_AA_LIST,56,73,71,47,CBS_DROPDOWNLIST | WS_VSCROLL | 
-                    WS_TABSTOP
-    COMBOBOX        IDC_VIDEO_LIST,56,95,71,30,CBS_DROPDOWNLIST | CBS_SORT | 
-                    WS_VSCROLL | WS_TABSTOP
-END
-
-IDD_OPT_AUDIO DIALOG DISCARDABLE  0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
-    CONTROL         "Force Audio Config",IDC_FORCE_AUDIO,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,5,33,77,10
-    LTEXT           "Number of buffers",IDC_STATIC,5,51,60,8
-    LTEXT           "Total Duration in ms",IDC_STATIC,4,69,64,8
-    EDITTEXT        IDC_EDIT_AUDIO,68,48,34,14,ES_AUTOHSCROLL | ES_READONLY
-    CONTROL         "Spin1",IDC_SPIN_AUDIO,"msctls_updown32",UDS_SETBUDDYINT | 
-                    UDS_ARROWKEYS | UDS_HORZ,105,49,19,12
-    EDITTEXT        IDC_AUDIO_DUR,68,67,34,14,ES_AUTOHSCROLL
-    CONTROL         "Spin1",IDC_SPIN_DUR,"msctls_updown32",UDS_SETBUDDYINT | 
-                    UDS_ARROWKEYS | UDS_HORZ,105,68,19,12
-    CONTROL         "Disable Audio Resync",IDC_AUDIO_RESYNC,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,5,85,84,10
-    LTEXT           "Default Plugin",IDC_STATIC,5,103,45,8
-    COMBOBOX        IDC_DRIVER_LIST,52,100,73,30,CBS_DROPDOWNLIST | CBS_SORT | 
-                    WS_VSCROLL | WS_TABSTOP
-END
-
-IDD_OPT_FONT DIALOG DISCARDABLE  0, 20, 133, 119
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
-    LTEXT           "Font Engine",IDC_STATIC,35,33,39,8
-    COMBOBOX        IDC_FONT_LIST,12,45,98,30,CBS_DROPDOWNLIST | CBS_SORT | 
-                    WS_VSCROLL | WS_TABSTOP
-    LTEXT           "Systems Font Directory",IDC_STATIC,19,87,76,8
-    PUSHBUTTON      "...",IDC_BROWSE_FONT,6,98,115,12
-    CONTROL         "Draw text through texturing",IDC_USE_TEXTURE,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,10,68,107,10
-END
-
-IDD_OPT_HTTP DIALOG DISCARDABLE  0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
-    LTEXT           "Cache Directory",IDC_STATIC,35,9,53,8
-    PUSHBUTTON      "...",IDC_BROWSE_CACHE,7,22,113,14
-    CONTROL         "Remove temp files",IDC_CLEAN_CACHE,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,7,43,75,10
-    CONTROL         "Always redownload incomplete cached files",
-                    IDC_RESTART_CACHE,"Button",BS_AUTOCHECKBOX | 
-                    BS_MULTILINE | WS_TABSTOP,7,54,102,22
-    CONTROL         "XML Progressive Load",IDC_SAX_PROGRESSIVE,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,8,77,85,10
-    EDITTEXT        IDC_SAX_DURATION,27,89,35,14,ES_CENTER | ES_AUTOHSCROLL | 
-                    ES_NUMBER
-END
-
-IDD_OPT_STREAM DIALOG DISCARDABLE  0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
-    LTEXT           "Default RTSP Port",IDC_STATIC,33,33,58,8
-    COMBOBOX        IDC_PORT,15,42,95,30,CBS_DROPDOWNLIST | CBS_SORT | 
-                    WS_VSCROLL | WS_TABSTOP
-    CONTROL         "RTP over RTSP",IDC_RTSP,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,1,58,64,10
-    CONTROL         "RTP Reordering",IDC_REORDER,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,66,58,66,10
-    EDITTEXT        IDC_TIMEOUT,1,72,35,14,ES_CENTER | ES_AUTOHSCROLL | 
-                    ES_NUMBER
-    LTEXT           "ms before control timeout",IDC_STATIC,44,75,83,8
-    EDITTEXT        IDC_BUFFER,1,87,35,14,ES_CENTER | ES_AUTOHSCROLL | 
-                    ES_NUMBER
-    LTEXT           "ms of Media Buffering ",IDC_STATIC,44,90,72,8
-    CONTROL         "Rebuffer if less than",IDC_REBUFFER,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,2,106,78,10
-    EDITTEXT        IDC_REBUFFER_LEN,81,105,35,12,ES_CENTER | ES_AUTOHSCROLL | 
-                    ES_NUMBER
-    LTEXT           "ms",IDC_STATIC,121,108,10,8
-END
-
-IDD_OPT_DECODER DIALOG DISCARDABLE  0, 20, 133, 121
-STYLE DS_MODALFRAME | DS_CONTROL | WS_CHILD
-FONT 8, "System"
-BEGIN
-    LTEXT           "Prefered Audio Output",-1,33,9,70,8
-    LTEXT           "Prefered Video Output",-1,33,44,80,8
-    COMBOBOX        IDC_AUDEC_LIST,11,22,109,54,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_VIDEC_LIST,12,57,109,47,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP
-END
-
-IDD_OPT_RENDER3D DIALOG DISCARDABLE  0, 0, 133, 121
-STYLE DS_MODALFRAME | WS_CHILD
-FONT 8, "System"
-BEGIN
-    CONTROL         "Use 3D Renderer",IDC_USE_3D_REN,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,3,29,121,10
-    CONTROL         "Disable Backface Culling",IDC_NO_BACKCULL,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,3,41,92,10
-    CONTROL         "Emulate pow2 textures for video",IDC_EMULATE_POW2,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,1,97,121,10
-    LTEXT           "Drawing Mode",IDC_STATIC,5,56,46,8
-    COMBOBOX        IDC_WIRE_MODE,61,54,61,35,CBS_DROPDOWN | WS_VSCROLL | 
-                    WS_TABSTOP
-    LTEXT           "Draw Normals",IDC_STATIC,5,73,45,8
-    COMBOBOX        IDC_DRAW_NORMALS,62,72,61,35,CBS_DROPDOWN | WS_VSCROLL | 
-                    WS_TABSTOP
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE 
-BEGIN
-    IDD_CONTROL, DIALOG
-    BEGIN
-        RIGHTMARGIN, 160
-        BOTTOMMARGIN, 14
-    END
-
-    IDD_OPTIONS, DIALOG
-    BEGIN
-        RIGHTMARGIN, 133
-        BOTTOMMARGIN, 120
-    END
-
-    IDD_OPT_GEN, DIALOG
-    BEGIN
-        RIGHTMARGIN, 132
-        BOTTOMMARGIN, 120
-    END
-
-    IDD_OPT_RENDER, DIALOG
-    BEGIN
-        RIGHTMARGIN, 132
-        BOTTOMMARGIN, 120
-    END
-
-    IDD_OPT_SYSTEMS, DIALOG
-    BEGIN
-        RIGHTMARGIN, 132
-        BOTTOMMARGIN, 120
-    END
-
-    IDD_OPT_VIDEO, DIALOG
-    BEGIN
-        RIGHTMARGIN, 132
-        BOTTOMMARGIN, 120
-    END
-
-    IDD_OPT_AUDIO, DIALOG
-    BEGIN
-        RIGHTMARGIN, 132
-        BOTTOMMARGIN, 120
-    END
-
-    IDD_OPT_FONT, DIALOG
-    BEGIN
-        RIGHTMARGIN, 132
-        BOTTOMMARGIN, 118
-    END
-
-    IDD_OPT_HTTP, DIALOG
-    BEGIN
-        RIGHTMARGIN, 132
-        BOTTOMMARGIN, 120
-    END
-
-    IDD_OPT_STREAM, DIALOG
-    BEGIN
-        RIGHTMARGIN, 132
-        BOTTOMMARGIN, 120
-    END
-
-    IDD_OPT_DECODER, DIALOG
-    BEGIN
-        RIGHTMARGIN, 132
-        BOTTOMMARGIN, 120
-    END
-END
-#endif    // APSTUDIO_INVOKED
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#include ""afxres.h""\r\n"
-    "#include ""newres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
-    "#define _AFX_NO_OLE_RESOURCES\r\n"
-    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
-    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
-    "\r\n"
-    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
-    "#ifdef _WIN32\r\n"
-    "LANGUAGE 9, 1\r\n"
-    "#pragma code_page(1252)\r\n"
-    "#endif //_WIN32\r\n"
-    "#include ""res\\Osmo4.rc2""  // non-Microsoft eMbedded Visual C++ edited resources\r\n"
-    "#include ""afxres.rc""         // Standard components\r\n"
-    "#include ""wceres.rc""         // WCE-specific components\r\n"
-    "#endif\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog Info
-//
-
-IDD_OPT_RENDER DLGINIT
-BEGIN
-    IDC_BIFS_RATE, 0x403, 8, 0
-0x0035, 0x002e, 0x0030, 0x0000, 
-    IDC_BIFS_RATE, 0x403, 8, 0
-0x0037, 0x002e, 0x0035, 0x0000, 
-    IDC_BIFS_RATE, 0x403, 10, 0
-0x0031, 0x0030, 0x002e, 0x0030, 0x0000, 
-    IDC_BIFS_RATE, 0x403, 10, 0
-0x0031, 0x0032, 0x002e, 0x0035, 0x0000, 
-    IDC_BIFS_RATE, 0x403, 10, 0
-0x0031, 0x0035, 0x002e, 0x0030, 0x0000, 
-    IDC_BIFS_RATE, 0x403, 10, 0
-0x0032, 0x0034, 0x002e, 0x0030, 0x0000, 
-    IDC_BIFS_RATE, 0x403, 10, 0
-0x0032, 0x0035, 0x002e, 0x0030, 0x0000, 
-    IDC_BIFS_RATE, 0x403, 10, 0
-0x0033, 0x0030, 0x002e, 0x0030, 0x0000, 
-    0
-END
-
-IDD_OPT_SYSTEMS DLGINIT
-BEGIN
-    IDC_DEC_THREAD, 0x403, 28, 0
-0x0053, 0x0069, 0x006e, 0x0067, 0x006c, 0x0065, 0x0020, 0x0054, 0x0068, 
-0x0072, 0x0065, 0x0061, 0x0064, 0x0000, 
-    IDC_DEC_THREAD, 0x403, 26, 0
-0x004d, 0x0075, 0x0074, 0x006c, 0x0069, 0x0020, 0x0054, 0x0068, 0x0072, 
-0x0065, 0x0061, 0x0064, 0x0000, 
-    IDC_DEC_THREAD, 0x403, 10, 0
-0x0046, 0x0072, 0x0065, 0x0065, 0x0000, 
-    0
-END
-
-#endif    // French (France) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-#define _AFX_NO_SPLITTER_RESOURCES
-#define _AFX_NO_OLE_RESOURCES
-#define _AFX_NO_TRACKER_RESOURCES
-#define _AFX_NO_PROPERTY_RESOURCES
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE 9, 1
-#pragma code_page(1252)
-#endif //_WIN32
-#include "res\Osmo4.rc2"  // non-Microsoft eMbedded Visual C++ edited resources
-#include "afxres.rc"         // Standard components
-//#include "wceres.rc"         // WCE-specific components
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
diff --git a/applications/osmo4_wce/ProgressBar.cpp b/applications/osmo4_wce/ProgressBar.cpp
deleted file mode 100644 (file)
index 313e31c..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-// ProgressBar.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "Osmo4.h"
-#include "ProgressBar.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// ProgressBar dialog
-
-
-ProgressBar::ProgressBar(CWnd* pParent /*=NULL*/)
-       : CDialog(ProgressBar::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(ProgressBar)
-       //}}AFX_DATA_INIT
-
-       m_grabbed = 0;
-       m_range_invalidated = 0;
-}
-
-
-void ProgressBar::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(ProgressBar)
-       DDX_Control(pDX, IDC_TIME, m_Time);
-       DDX_Control(pDX, IDC_SLIDER, m_Slider);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(ProgressBar, CDialog)
-       //{{AFX_MSG_MAP(ProgressBar)
-       ON_WM_SIZE()
-       ON_WM_HSCROLL()
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// ProgressBar message handlers
-#define TEXT_RIGHT_PAD 2
-void ProgressBar::OnSize(UINT nType, int cx, int cy) 
-{
-       u32 tw;
-       CDialog::OnSize(nType, cx, cy);
-
-       if (!m_Slider.m_hWnd) return;
-
-       RECT rc;
-       m_Time.GetClientRect(&rc);
-       tw = rc.right-rc.left;
-       rc.left = cx - tw - TEXT_RIGHT_PAD;
-       rc.right = cx - TEXT_RIGHT_PAD;
-       m_Time.MoveWindow(&rc);
-       m_Slider.GetClientRect(&rc);
-       rc.left = 0;
-       rc.right = cx - tw - TEXT_RIGHT_PAD;
-       m_Slider.MoveWindow(&rc);
-}
-
-void ProgressBar::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
-{
-       COsmo4 *app = GetApp();
-
-       if (pScrollBar->GetDlgCtrlID() == IDC_SLIDER) {
-               if (!app->m_can_seek) return;
-               switch (nSBCode) {
-               case TB_LINEUP:
-               case TB_LINEDOWN:
-               case TB_PAGEUP:
-               case TB_PAGEDOWN:
-               case TB_THUMBPOSITION:
-               case TB_THUMBTRACK:
-               case TB_TOP:
-               case TB_BOTTOM:
-                       m_grabbed = 1;
-                       break;
-               case TB_ENDTRACK:
-                       if (!app->m_open) {
-                               SetPosition(0);
-                       } else {
-                               u32 seek_to = m_Slider.GetPos();
-                               gf_term_play_from_time(app->m_term, seek_to, 0);
-                       }
-                       m_grabbed = 0;
-                       return;
-               }
-       }
-       CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
-}
-
-void ProgressBar::SetPosition(u32 now)
-{
-       TCHAR swText[20];
-       u32 nb_s, nb_m;
-       COsmo4 *app = GetApp();
-
-       if (m_range_invalidated) {
-               if (app->m_can_seek) {
-                       m_Slider.SetRangeMin(0);
-                       m_Slider.SetRangeMax(app->m_duration);
-                       m_Slider.ShowWindow(SW_SHOWNORMAL);
-                       m_Slider.EnableWindow(TRUE);
-               } else {
-                       m_Slider.ShowWindow(SW_SHOWNORMAL);
-                       m_Slider.EnableWindow(FALSE);
-                       
-               }
-               m_range_invalidated = 0;
-       }
-       if (now==m_prev_time) return;
-
-       if (now<m_prev_time) m_prev_time = 0;
-       
-       if (!m_prev_time || (m_prev_time + 500 <= now)) {
-               m_FPS = gf_term_get_framerate(app->m_term, 0);
-               m_prev_time = now;
-       }
-       nb_s = now/1000;
-       nb_m = nb_s/60;
-       nb_s -= nb_m*60;
-       wsprintf(swText, _T("%02d:%02d FPS %02.2f"), nb_m, nb_s, m_FPS);
-       m_Time.SetWindowText(swText);
-       
-       if (!m_grabbed) m_Slider.SetPos(now);
-}
diff --git a/applications/osmo4_wce/ProgressBar.h b/applications/osmo4_wce/ProgressBar.h
deleted file mode 100644 (file)
index fbd2c57..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#if !defined(AFX_PROGRESSBAR_H__85FCAC2B_9C83_4C83_8E66_D712FC88B221__INCLUDED_)
-#define AFX_PROGRESSBAR_H__85FCAC2B_9C83_4C83_8E66_D712FC88B221__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// ProgressBar.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// ProgressBar dialog
-
-class ProgressBar : public CDialog
-{
-// Construction
-public:
-       ProgressBar(CWnd* pParent = NULL);   // standard constructor
-
-       Bool m_grabbed, m_range_invalidated;
-       Double m_FPS;
-       u32 m_prev_time;
-       void SetPosition(u32 time_ms);
-
-// Dialog Data
-       //{{AFX_DATA(ProgressBar)
-       enum { IDD = IDD_CONTROL };
-       CStatic m_Time;
-       CSliderCtrl     m_Slider;
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(ProgressBar)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(ProgressBar)
-       afx_msg void OnSize(UINT nType, int cx, int cy);
-       afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_PROGRESSBAR_H__85FCAC2B_9C83_4C83_8E66_D712FC88B221__INCLUDED_)
diff --git a/applications/osmo4_wce/Resource.h b/applications/osmo4_wce/Resource.h
deleted file mode 100644 (file)
index 588802a..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft eMbedded Visual C++ generated include file.
-// Used by Osmo4.rc
-//
-#define IDD_ABOUTBOX                    100
-#define IDM_MENU                        101
-#define IDS_EDIT                        102
-#define IDS_TOOL                        103
-#define IDP_SOCKETS_INIT_FAILED         104
-#define IDR_MAIN_EDIT                   105
-#define IDR_MAIN_TOOL                   106
-#define IDI_PAUSE                       120
-#define IDD_OPT_HTTP                    121
-#define IDR_MAINFRAME                   128
-#define IDD_OPT_AUDIO                   129
-#define IDD_OPENFILE                    130
-#define IDD_CONTROL                     131
-#define IDD_OPTIONS                     132
-#define IDD_OPT_GEN                     133
-#define IDD_OPT_RENDER                  134
-#define IDD_OPT_SYSTEMS                 135
-#define IDD_OPT_VIDEO                   136
-#define IDI_PLAY                        137
-#define IDD_OPT_FONT                    138
-#define IDI_STOP                        139
-#define IDD_OPT_STREAM                  140
-#define IDR_MENU                        141
-#define IDD_OPT_RENDER3D                142
-#define IDD_OPT_DECODER                 143
-#define IDC_FILELIST                    1000
-#define IDC_BROWSE                      1001
-#define IDC_SEEK                        1002
-#define IDC_PLAY                        1003
-#define IDC_STOP                        1004
-#define IDC_OPT_SET_NAME                1005
-#define IDC_SAVEOPT                     1006
-#define IDC_LOOP                        1007
-#define IDC_AUTOSTART                   1008
-#define IDC_NO_CONSOLE                  1009
-#define IDC_FILEASSOC                   1010
-#define IDC_BIFS_RATE                   1011
-#define IDC_DIRECTRENDER                1012
-#define IDC_ZOOM_SCALABLE               1013
-#define IDC_FAST_RENDER                 1014
-#define IDC_FORCE_SIZE                  1015
-#define IDC_COLOR                       1016
-#define IDC_LANG                        1017
-#define IDC_DEC_THREAD                  1018
-#define IDC_BIFSDROP                    1019
-#define IDC_FORCE_DURATION              1020
-#define IDC_SLIDER                      1021
-#define IDC_GD_LIST                     1022
-#define IDC_AA_LIST                     1023
-#define IDC_VIDEO_LIST                  1024
-#define IDC_FORCE_AUDIO                 1025
-#define IDC_EDIT_AUDIO                  1026
-#define IDC_SPIN_AUDIO                  1027
-#define IDC_AUDIO_FPS                   1028
-#define IDC_SPIN_DUR                    1029
-#define IDC_AUDIO_RESYNC                1030
-#define IDC_DRIVER_LIST                 1031
-#define IDC_FONT_LIST                   1032
-#define IDC_BROWSE_FONT                 1033
-#define IDC_BROWSE_CACHE                1034
-#define IDC_CLEAN_CACHE                 1035
-#define IDC_RESTART_CACHE               1036
-#define IDC_PORT                        1037
-#define IDC_RTSP                        1038
-#define IDC_REORDER                     1039
-#define IDC_TIMEOUT                     1040
-#define IDC_BUFFER                      1041
-#define IDC_REBUFFER                    1042
-#define IDC_REBUFFER_LEN                1043
-#define IDC_VERSION                     1044
-#define IDC_AUDEC_LIST                  1046
-#define IDC_VIDEC_LIST                  1047
-#define IDC_COMBOSEL                    1048
-#define IDC_TIME                        1049
-#define IDC_ABT_TEXT                    1050
-#define IDC_CTRL_PLAY                   1051
-#define IDC_USE_TEXTURE                 1052
-#define IDC_USE_3D_REN                  1053
-#define IDC_NO_BACKCULL                 1054
-#define IDC_CTRL_STOP                   1055
-#define IDC_EMULATE_POW2                1056
-#define IDC_WIRE_MODE                   1057
-#define IDC_SAX_DURATION                1058
-#define IDC_DRAW_NORMALS                1059
-#define IDC_SPIN_OPT                    1060
-#define IDC_AUDIO_DUR                   1061
-#define IDC_SPIN_FPS                    1062
-#define IDC_FILL_SCREEN                 1063
-#define IDC_VIEW_FPS                    1064
-#define IDC_NO_BACKLIGHT                1065
-#define IDC_SAX_PROGRESSIVE             1066
-#define IDC_ENABLE_LOGS                 1067
-#define IDS_CAP_FILE                    32772
-#define ID_FILE_RESTART                 32773
-#define ID_FPS_DISP                     32774
-#define IDD_CONFIGURE                   32775
-#define ID_VIEW_CONTROL                 32776
-#define ID_FILE_PAUSE                   32777
-#define ID_FILE_STEP                    32778
-#define ID_FILE_STOP                    32779
-#define ID_VIEW_FULLSCREEN              32780
-#define ID_FILE                         32781
-#define ID_MENUITEM32789                32782
-#define IDS_CAP_MENUITEM32790           32783
-#define ID_VIEW                         32784
-#define IDS_CAP_VIEW                    32785
-#define ID_OPEN_FILE                    32786
-#define ID_OPEN_URL                     32787
-#define ID_SHORTCUTS                    32788
-#define ID_VIEW_FIT                     32789
-#define ID_NAV_NONE                     32806
-#define ID_NAV_SLIDE                    32807
-#define ID_NAV_RESET                    32808
-#define ID_NAV_WALK                     32810
-#define ID_NAV_FLY                      32811
-#define ID_NAV_EXAMINE                  32812
-#define ID_NAV_GRAVITY                  32813
-#define ID_COLLIDE_OFF                  32815
-#define ID_COLLIDE_REG                  32816
-#define ID_COLLIDE_DISP                 32817
-#define ID_VIEWPORT_EMPTY               32818
-#define ID_NAV_HEADLIGHT                32819
-#define ID_VP_0                         32820
-#define ID_VP_1                         32821
-#define ID_VP_2                         32822
-#define ID_VP_3                         32823
-#define ID_VP_4                         32824
-#define ID_VP_5                         32825
-#define ID_VP_6                         32826
-#define ID_VP_7                         32827
-#define ID_VP_8                         32828
-#define ID_VP_9                         32829
-#define ID_VP_10                        32830
-#define ID_VP_11                        32831
-#define ID_VP_12                        32832
-#define ID_VP_13                        32833
-#define ID_VP_14                        32834
-#define ID_VP_15                        32835
-#define ID_VP_16                        32836
-#define ID_VP_17                        32837
-#define ID_VP_18                        32838
-#define ID_VP_19                        32839
-#define ID_VIEW_AR_ORIG                 32890
-#define ID_VIEW_AR_FILL                 32891
-#define ID_VIEW_AR_43                   32892
-#define ID_VIEW_AR_169                  32893
-#define ID_VIEW_TIMING                  32894
-#define IDS_NEW                         65000
-#define IDS_FILE                        65001
-#define IDS_MHELP                       65002
-#define IDS_SAVE                        65003
-#define IDS_CUT                         65004
-#define IDS_COPY                        65005
-#define IDS_PASTE                       65006
-#define IDS_ABOUT                       65007
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        143
-#define _APS_NEXT_COMMAND_VALUE         32820
-#define _APS_NEXT_CONTROL_VALUE         1059
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
diff --git a/applications/osmo4_wce/StdAfx.cpp b/applications/osmo4_wce/StdAfx.cpp
deleted file mode 100644 (file)
index e6caa79..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-//     Osmo4.pch will be the pre-compiled header
-//     stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
diff --git a/applications/osmo4_wce/StdAfx.h b/applications/osmo4_wce/StdAfx.h
deleted file mode 100644 (file)
index 93d8297..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// stdafx.h : include file for standard system include files,
-//  or project specific include files that are used frequently, but
-//      are changed infrequently
-//
-
-#if !defined(AFX_STDAFX_H__C81DFFE9_41A3_474E_A044_3A730DB4FFD6__INCLUDED_)
-#define AFX_STDAFX_H__C81DFFE9_41A3_474E_A044_3A730DB4FFD6__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-#if (_WIN32_WCE <= 200)
-#error This project does not support MFCCE 2.00 or earlier, because it requires CControlBar, available only in MFCCE 2.01 or later
-#endif
-
-#if (_WIN32_WCE <= 211)
-#error This project can not be built for H/PC Pro 2.11 or earlier platforms.
-#endif
-
-#define VC_EXTRALEAN           // Exclude rarely-used stuff from Windows headers
-
-#include <afxwin.h>         // MFC core and standard components
-#include <afxext.h>         // MFC extensions
-
-#if defined(_AFXDLL)
-#include <afxdtctl.h>          // MFC support for Internet Explorer 4 Common Controls
-#endif
-
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h>                    // MFC support for Windows Common Controls
-#endif // _AFX_NO_AFXCMN_SUPPORT
-
-#include <afxsock.h>           // MFC socket extensions
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__C81DFFE9_41A3_474E_A044_3A730DB4FFD6__INCLUDED_)
diff --git a/applications/osmo4_wce/newres.h b/applications/osmo4_wce/newres.h
deleted file mode 100644 (file)
index 31c3a43..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef __NEWRES_H__
-#define __NEWRES_H__
-
-#define  SHMENUBAR RCDATA
-#if !(defined(_WIN32_WCE_PSPC) && (_WIN32_WCE >= 300))
-       #undef HDS_HORZ  
-       #undef HDS_BUTTONS 
-       #undef HDS_HIDDEN 
-
-       #include <commctrl.h>
-       // for MenuBar
-       #define I_IMAGENONE             (-2)
-       #define NOMENU                  0xFFFF
-       #define IDS_SHNEW               1
-       #define IDM_SHAREDNEW        10
-       #define IDM_SHAREDNEWDEFAULT 11
-
-       // for Tab Control
-       #define TCS_SCROLLOPPOSITE      0x0001   // assumes multiline tab
-       #define TCS_BOTTOM              0x0002
-       #define TCS_RIGHT               0x0002
-       #define TCS_VERTICAL            0x0080
-       #define TCS_MULTISELECT         0x0004  // allow multi-select in button mode
-       #define TCS_FLATBUTTONS         0x0008  
-#endif //_WIN32_WCE_PSPC
-
-
-#endif //__NEWRES_H__
diff --git a/applications/osmo4_wce/res/Cmdbar.bmp b/applications/osmo4_wce/res/Cmdbar.bmp
deleted file mode 100644 (file)
index 90764e4..0000000
Binary files a/applications/osmo4_wce/res/Cmdbar.bmp and /dev/null differ
diff --git a/applications/osmo4_wce/res/Osmo4.ico b/applications/osmo4_wce/res/Osmo4.ico
deleted file mode 100644 (file)
index 96d9091..0000000
Binary files a/applications/osmo4_wce/res/Osmo4.ico and /dev/null differ
diff --git a/applications/osmo4_wce/res/Osmo4.rc2 b/applications/osmo4_wce/res/Osmo4.rc2
deleted file mode 100644 (file)
index 960d255..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// OSMO4.RC2 - resources Microsoft eMbedded Visual C++ does not edit directly
-//
-
-#ifdef APSTUDIO_INVOKED
-       #error this file is not editable by Microsoft eMbedded Visual C++
-#endif //APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Add manually edited resources here...
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/applications/osmo4_wx/Darwin.Info.plist b/applications/osmo4_wx/Darwin.Info.plist
deleted file mode 100644 (file)
index 710c02d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>CFBundleDevelopmentRegion</key>
-       <string>English</string>
-       <key>CFBundleExecutable</key>
-       <string>Osmo4</string>
-       <key>CFBundleGetInfoString</key>
-       <string>Osmo4 0.4.2</string>
-       <key>CFBundleIconFile</key>
-       <string>Osmo</string>
-       <key>CFBundleIdentifier</key>
-       <string>org.gpac.Osmo4</string>
-       <key>CFBundleInfoDictionaryVersion</key>
-       <string>0.4.2</string>
-       <key>CFBundlePackageType</key>
-       <string>APPL</string>
-       <key>CFBundleShortVersionString</key>
-       <string>0.4.2</string>
-       <key>CFBundleSignature</key>
-       <string>Omo4</string>
-       <key>CFBundleVersion</key>
-       <string>0.4.2</string>
-       <key>NSHumanReadableCopyright</key>
-       <string>Copyright (c) 2003-2005 gpac</string>
-       <key>NSMainNibFile</key>
-       <string>NSMainNibFile</string>
-       <key>NSPrincipalClass</key>
-       <string>NSApplication</string>
-</dict>
-</plist>
diff --git a/applications/osmo4_wx/Darwin.InfoPlist.strings b/applications/osmo4_wx/Darwin.InfoPlist.strings
deleted file mode 100644 (file)
index 2efc670..0000000
Binary files a/applications/osmo4_wx/Darwin.InfoPlist.strings and /dev/null differ
diff --git a/applications/osmo4_wx/Darwin.Osmo.icns b/applications/osmo4_wx/Darwin.Osmo.icns
deleted file mode 100644 (file)
index a598061..0000000
Binary files a/applications/osmo4_wx/Darwin.Osmo.icns and /dev/null differ
diff --git a/applications/osmo4_wx/Makefile b/applications/osmo4_wx/Makefile
deleted file mode 100644 (file)
index ca72be1..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-include ../../config.mak
-
-vpath %.cpp $(SRC_PATH)/applications/osmo4_wx
-
-CFLAGS= $(CPPFLAGS) -I"$(SRC_PATH)/include"
-
-ifeq ($(DEBUGBUILD), yes)
-CFLAGS+=-g
-LDFLAGS+=-g
-endif
-
-ifeq ($(GPROFBUILD), yes)
-CFLAGS+=-pg
-LDFLAGS+=-pg
-endif
-
-ifeq ($(GPACREADONLY), yes)
-CFLAGS+=-DGPAC_READ_ONLY
-endif
-
-#common obj
-OBJS= wxOsmo4.o wxGPACControl.o fileprops.o Playlist.o menubtn.o
-
-ifeq ($(CONFIG_WIN32),yes)
-EXE=.exe
-PROG=Osmo4$(EXE)
-else
-EXT=
-PROG=Osmo4
-endif
-
-#3 - spidermonkey support
-ifeq ($(CONFIG_JS),no)
-else
-SCENEGRAPH_CFLAGS+=$(JS_FLAGS)
-ifeq ($(CONFIG_JS),local)
-NEED_LOCAL_LIB="yes"
-endif
-LDFLAGS+=$(JS_LIBS)
-endif
-
-
-SRCS := $(OBJS:.o=.cpp) 
-
-all: $(PROG)
-
-Osmo4$(EXE): $(OBJS)
-       $(CC) $(LDFLAGS) -o ../../bin/gcc/$@ $(OBJS) -L../../bin/gcc -lgpac $(WX_LFLAGS)
-
-%.o: %.cpp
-       $(CXX) $(CFLAGS) $(WX_CFLAGS) -c -o $@ $< 
-
-clean: 
-       rm -f $(OBJS) ../../bin/gcc/$(PROG)
-
-install: 
-ifeq ($(CONFIG_DARWIN),yes)
-       mkdir -p $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/MacOS
-       mkdir -p $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/Resources/English.lproj
-       cp ./Darwin.Info.plist \
-          $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/Info.plist
-       cp ./Darwin.InfoPlist.strings \
-          $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/Resources/English.lproj/InfoPlist.strings
-       cp ./Darwin.Osmo.icns \
-          $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/Resources/Osmo.icns
-       install -m 755 $(INSTFLAGS) ../../bin/gcc/Osmo4 \
-             $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/MacOS
-       echo -n 'APPLOsm4' > $(DESTDIR)$(mac_apps)/Osmo4.app/Contents/PkgInfo
-else
-       rm -f wxOsmo4.o
-       mkdir -p $(DESTDIR)$(prefix)/bin
-       install -m 755 $(INSTFLAGS) ../../bin/gcc/Osmo4 "$(DESTDIR)$(prefix)/bin"
-endif
-
-uninstall:
-       rm -rf $(DESTDIR)$(prefix)/bin/Osmo4
-
-dep:
-
-depend:
-       rm -f .depend   
-       $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
-
-distclean: clean
-       rm -f Makefile.bak .depend
-
-
-
-# include dependency files if they exist
-#
-ifneq ($(wildcard .depend),)
-include .depend
-endif
-
diff --git a/applications/osmo4_wx/Playlist.cpp b/applications/osmo4_wx/Playlist.cpp
deleted file mode 100644 (file)
index 7ed47a6..0000000
+++ /dev/null
@@ -1,826 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) Jean Le Feuvre 2000-2005
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- *  GPAC is gf_free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- *             
- */
-
-#include "wxOsmo4.h"
-#include "Playlist.h"
-
-
-#include "playlist.xpm"
-
-PLEntry::PLEntry(wxString url)
-{
-       m_url = gf_strdup(url.mb_str(wxConvUTF8));
-       Bool is_remote = 0;;
-       wxCharBuffer the_url = (const char *) url.mb_str(wxConvUTF8);
-       const char *_url = strstr(the_url, "://");
-       if (_url) {_url += 3; is_remote = 1; }
-       else _url = (const char *) the_url;
-
-       char *str = (char*)strrchr(_url, '\\');
-       if (!str) str = (char*)strrchr(_url, '/');
-       if (str && strlen(str+1)) {
-               m_disp_name = gf_strdup(str+1);
-               str = strrchr(m_disp_name, '.');
-               if (str) str[0] = 0;
-       } else {
-               m_disp_name = gf_strdup(_url);
-               if (!is_remote) {
-                       str = strrchr(m_disp_name, '.');
-                       if (str) str[0] = 0;
-               }
-       }
-       m_duration = 0;
-       m_bIsDead = 0;
-       m_bIsPlaying = 0;
-       m_bIsSelected = 0;
-}
-
-PLEntry::~PLEntry()
-{
-       if (m_url) gf_free(m_url);
-       if (m_disp_name) gf_free(m_disp_name);
-
-}
-
-wxPlaylist::wxPlaylist(wxWindow *parent)
-             : wxFrame(parent, -1, wxString(_T("Osmo4 Playlist")), wxDefaultPosition, wxDefaultSize, 
-                        wxCLOSE_BOX | wxSYSTEM_MENU | wxCAPTION | wxRESIZE_BORDER)
-{
-
-       m_pApp = (wxOsmo4Frame *)parent;
-
-       m_pOpen = new wxBitmap(pl_open);
-       m_pSave = new wxBitmap(pl_save);
-       m_pAdd = new wxBitmap(pl_add);
-       m_pRem = new wxBitmap(pl_rem);
-       m_pUp = new wxBitmap(pl_up);
-       m_pDown = new wxBitmap(pl_down);
-       m_pSort = new wxBitmap(pl_sort);
-
-       m_pToolBar = CreateToolBar(wxTB_HORIZONTAL);
-       m_pAddBut = new wxMenuButton(m_pToolBar, ID_PL_ADD_FILE, *m_pAdd);
-       wxMenu *menu = new wxMenu();
-       menu->Append(ID_PL_ADD_URL, wxT("&Url"));
-       menu->Append(ID_PL_ADD_DIR, wxT("&Directory"));
-       menu->Append(ID_PL_ADD_DIR_REC, wxT("&Directory and subfolders"));
-       m_pAddBut->AssignMenu(menu);
-       m_pAddBut->SetToolTip(wxString(wxT("Add Files")));
-
-       m_pRemBut = new wxMenuButton(m_pToolBar, ID_PL_REM_FILE, *m_pRem);
-       menu = new wxMenu();
-       menu->Append(ID_PL_REM_ALL, wxT("&Clear"));
-       menu->Append(ID_PL_REM_DEAD, wxT("&Remove dead entries"));
-       m_pRemBut->AssignMenu(menu);
-       m_pRemBut->SetToolTip(wxString(wxT("Remove Selected Files")));
-
-       m_pSortBut = new wxMenuButton(m_pToolBar, ID_PL_SORT_FILE, *m_pSort);
-       menu = new wxMenu();
-       menu->Append(ID_PL_SORT_TITLE, wxT("&Sort by Title"));
-       menu->Append(ID_PL_SORT_FILE, wxT("&Sort by file name"));
-       menu->Append(ID_PL_SORT_DUR, wxT("&Sort by Duration"));
-       menu->AppendSeparator();
-       menu->Append(ID_PL_REVERSE, wxT("&Reverse"));
-       menu->Append(ID_PL_RANDOMIZE, wxT("&Randomize"));
-       m_pSortBut->AssignMenu(menu);
-       m_pSortBut->SetToolTip(wxString(wxT("Sort Playlist by filename")));
-
-       m_pToolBar->AddTool(ID_PL_OPEN, wxT(""), *m_pOpen, wxT("Open Playlist"));
-       m_pToolBar->AddTool(ID_PL_SAVE, wxT(""), *m_pSave, wxT("Save Playlist"));
-       m_pToolBar->AddSeparator();
-       m_pToolBar->AddControl(m_pAddBut);
-       m_pToolBar->AddControl(m_pRemBut);
-       m_pToolBar->AddSeparator();
-       m_pToolBar->AddTool(ID_PL_UP, wxT(""), *m_pUp, wxT("Moves Selected Files Up"));
-       m_pToolBar->AddTool(ID_PL_DOWN, wxT(""), *m_pDown, wxT("Moves Selected Files Down"));
-       m_pToolBar->AddSeparator();
-       m_pToolBar->AddControl(m_pSortBut);
-       m_pToolBar->Realize();
-
-       m_FileList = new wxListCtrl(this, ID_FILE_LIST, wxDefaultPosition, wxDefaultSize, wxLC_REPORT);
-
-       m_FileList->InsertColumn(0, wxT(""), wxLIST_FORMAT_LEFT, 1);
-       m_FileList->InsertColumn(1, wxT("Title"), wxLIST_FORMAT_LEFT, 1);
-       m_FileList->InsertColumn(2, wxT("Duration"), wxLIST_FORMAT_LEFT, 1);
-
-       m_entries = gf_list_new();
-       m_cur_entry = -1;
-       m_all_dead_entries = -1;
-
-       SetSize(220, 380);
-       Centre();
-}
-
-wxPlaylist::~wxPlaylist()
-{
-       Clear();
-       gf_list_del(m_entries);
-       delete m_pAddBut;
-       delete m_pRemBut;
-       delete m_pSortBut;
-       delete m_pOpen;
-       delete m_pSave;
-       delete m_pAdd;
-       delete m_pRem;
-       delete m_pUp;
-       delete m_pDown;
-       delete m_pSort;
-}
-
-
-BEGIN_EVENT_TABLE(wxPlaylist, wxWindow)
-       EVT_CLOSE(wxPlaylist::OnClose)
-       EVT_SIZE(wxPlaylist::OnSize)
-       EVT_TOOL(ID_PL_ADD_FILE, wxPlaylist::OnAddFile) 
-       EVT_TOOL(ID_PL_ADD_URL, wxPlaylist::OnAddURL) 
-       EVT_TOOL(ID_PL_ADD_DIR, wxPlaylist::OnAddDir) 
-       EVT_TOOL(ID_PL_ADD_DIR_REC, wxPlaylist::OnAddDirRec) 
-       EVT_TOOL(ID_PL_REM_FILE, wxPlaylist::OnRemFile) 
-       EVT_TOOL(ID_PL_REM_ALL, wxPlaylist::OnRemAll) 
-       EVT_TOOL(ID_PL_REM_DEAD, wxPlaylist::OnRemDead) 
-       EVT_TOOL(ID_PL_UP, wxPlaylist::OnSelUp) 
-       EVT_TOOL(ID_PL_DOWN, wxPlaylist::OnSelDown) 
-       EVT_TOOL(ID_PL_SAVE, wxPlaylist::OnSave) 
-       EVT_TOOL(ID_PL_OPEN, wxPlaylist::OnOpen) 
-       EVT_MENU(ID_PL_PLAY, wxPlaylist::OnPlay) 
-       EVT_MENU(ID_PL_RANDOMIZE, wxPlaylist::OnRandomize) 
-       EVT_MENU(ID_PL_REVERSE, wxPlaylist::OnReverseList) 
-       EVT_MENU(ID_PL_SEL_REV, wxPlaylist::OnReverseSelection) 
-       EVT_MENU(ID_PL_SORT_TITLE, wxPlaylist::OnSortTitle) 
-       EVT_MENU(ID_PL_SORT_FILE, wxPlaylist::OnSortFile) 
-       EVT_MENU(ID_PL_SORT_DUR, wxPlaylist::OnSortDuration) 
-       EVT_LIST_ITEM_ACTIVATED(ID_FILE_LIST, wxPlaylist::OnItemActivate) 
-       EVT_LIST_ITEM_RIGHT_CLICK(ID_FILE_LIST, wxPlaylist::OnRightClick)
-END_EVENT_TABLE()
-
-void wxPlaylist::OnClose(wxCloseEvent &event)
-{
-       if (event.CanVeto()) {
-               event.Veto();
-               Hide();
-       }
-}
-
-void wxPlaylist::OnSize(wxSizeEvent &event)
-{
-       wxSize s = event.GetSize();
-       m_FileList->SetSize(0, 0, s.GetWidth()-2, s.GetHeight());
-       m_FileList->SetColumnWidth(0, 30);
-       m_FileList->SetColumnWidth(2, 60);
-       m_FileList->SetColumnWidth(1, s.GetWidth()-96);
-}
-
-void wxPlaylist::Clear()
-{
-       m_FileList->DeleteAllItems();
-       while (gf_list_count(m_entries)) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, 0);
-               gf_list_rem(m_entries, 0);
-               delete ple;
-       }
-       m_cur_entry = -1;
-}
-
-void wxPlaylist::ClearButPlaying()
-{
-       PLEntry *p = NULL;
-       if (m_cur_entry >= 0) {
-               p = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-               gf_list_rem(m_entries, m_cur_entry);
-       }
-       Clear();
-       if (p) {
-               gf_list_add(m_entries, p);
-               m_cur_entry = 0;
-       }
-       RefreshList();
-}
-
-void wxPlaylist::UpdateEntry(u32 idx)
-{
-       char szText[20];
-
-       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, idx);
-       if (idx+1<10) sprintf(szText, "00%d", idx+1);
-       else if (idx+1<100) sprintf(szText, "0%d", idx+1);
-       else sprintf(szText, "%d", idx+1);
-       m_FileList->SetItem(idx, 0, wxString(szText, wxConvUTF8));
-
-       wxString str;
-       if (ple->m_bIsDead) str = wxT("!! ") + wxString(ple->m_disp_name, wxConvUTF8) + wxT(" (DEAD)!!)");
-       else if (ple->m_bIsPlaying) str = wxT(">> ") + wxString(ple->m_disp_name, wxConvUTF8) + wxT(" >>");
-       else str = wxString(ple->m_disp_name, wxConvUTF8);
-       m_FileList->SetItem(idx, 1, str);
-       
-       if (ple->m_duration) {
-               u32 h = (u32) (ple->m_duration / 3600);
-               u32 m = (u32) (ple->m_duration / 60) - h*60;
-               u32 s = (u32) (ple->m_duration) - h*3600 - m*60;
-               m_FileList->SetItem(idx, 2, wxString::Format(wxT("%02d:%02d:%02d"), h, m, s) );
-       } else {
-               m_FileList->SetItem(idx, 2, wxT("Unknown"));
-       }
-}
-
-void wxPlaylist::RefreshList()
-{
-       u32 i, top_idx;
-       char szPath[GF_MAX_PATH];
-       Bool first_sel;
-
-       top_idx = m_FileList->GetTopItem();
-       m_FileList->DeleteAllItems();
-
-       first_sel = 0;
-       for (i=0; i<gf_list_count(m_entries); i++) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
-               m_FileList->InsertItem(i, wxT(""));
-               /*cast for 64-bit compilation*/
-               m_FileList->SetItemData(i, (unsigned long) ple);
-               UpdateEntry(i);
-
-               if (ple->m_bIsPlaying) m_cur_entry = i;
-
-               if (ple->m_bIsSelected) {
-                       m_FileList->SetItemState(i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED | wxLIST_MASK_STATE);
-                       ple->m_bIsSelected = 0;
-                       /*ensure first item of selection is visible*/
-                       if (!first_sel) {
-                               first_sel = 1;
-                               top_idx = i;
-                       }
-               }
-       }
-       
-       if (m_cur_entry >= (s32) gf_list_count(m_entries)-1) m_cur_entry = gf_list_count(m_entries)-1;
-       else {
-               s32 last_idx = top_idx + m_FileList->GetCountPerPage();
-               m_FileList->EnsureVisible(top_idx);
-               if (gf_list_count(m_entries)<1+ (u32) last_idx) last_idx = gf_list_count(m_entries)-1;
-               m_FileList->EnsureVisible(last_idx);
-       }
-
-       strcpy((char *) szPath, m_pApp->szAppPath);
-#ifdef WIN32
-       strcat(szPath, "gpac_pl.m3u");
-#else
-       strcat(szPath, ".gpac_pl.m3u");
-#endif
-       Save(szPath, 1);
-}
-
-void wxPlaylist::OnAddFile(wxCommandEvent &WXUNUSED(event)) 
-{
-       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), m_pApp->GetFileFilter(), wxOPEN | wxCHANGE_DIR | /*wxHIDE_READONLY |*/ wxMULTIPLE);
-
-       if (dlg.ShowModal() == wxID_OK) {
-               wxArrayString stra;
-               dlg.GetPaths(stra);
-               for (u32 i=0; i<stra.GetCount(); i++) {
-                       PLEntry *ple = new PLEntry(stra[i]);
-                       gf_list_add(m_entries, ple);
-               }
-               m_all_dead_entries = -1;
-               RefreshList();
-       }
-}
-
-
-static Bool pl_enum_dir_item(void *cbck, char *item_name, char *item_path)
-{
-       wxPlaylist *_this = (wxPlaylist *)cbck;
-
-       if (gf_term_is_supported_url(_this->m_pApp->m_term, item_name, 0, 1)) {
-               PLEntry *ple = new PLEntry(wxString(item_path, wxConvUTF8) );
-               gf_list_add(_this->m_entries, ple);
-       }
-       return 0;
-}
-
-static Bool pl_enum_dir_dirs(void *cbck, char *item_name, char *item_path)
-{
-       gf_enum_directory(item_path, 0, pl_enum_dir_item, cbck, NULL);
-       gf_enum_directory(item_path, 1, pl_enum_dir_dirs, cbck, NULL);
-       return 0;
-}
-
-
-void wxPlaylist::AddDir(Bool do_recurse) 
-{
-       wxDirDialog dlg(this);
-       dlg.SetPath(wxString(szCacheDir, wxConvUTF8) );
-       if (dlg.ShowModal() != wxID_OK) return;
-
-       strcpy(szCacheDir, dlg.GetPath().mb_str(wxConvUTF8));
-       gf_enum_directory(szCacheDir, 0, pl_enum_dir_item, this, NULL);
-       if (do_recurse) gf_enum_directory(szCacheDir, 1, pl_enum_dir_dirs, this, NULL);
-       m_all_dead_entries = -1;
-       RefreshList();
-}
-void wxPlaylist::OnAddDir(wxCommandEvent &WXUNUSED(event)) 
-{
-       AddDir(0);
-}
-void wxPlaylist::OnAddDirRec(wxCommandEvent &WXUNUSED(event)) 
-{
-       AddDir(1);
-}
-
-void wxPlaylist::OnAddURL(wxCommandEvent &WXUNUSED(event)) 
-{
-       OpenURLDlg dlg(this, m_pApp->m_user.config);
-       if (dlg.ShowModal() != wxID_OK) return;
-       PLEntry *ple = new PLEntry(dlg.m_urlVal);
-       gf_list_add(m_entries, ple);
-       m_all_dead_entries = -1;
-       RefreshList();
-}
-
-void wxPlaylist::OnRemFile(wxCommandEvent &WXUNUSED(event)) 
-{
-       if (!m_FileList->GetSelectedItemCount()) return;
-
-       long item = -1;
-       for (;;) {
-        item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
-               if (item == -1) break;
-               PLEntry *ple = (PLEntry *) m_FileList->GetItemData(item);
-               gf_list_del_item(m_entries, ple);
-               delete ple;
-    }
-       RefreshList();
-}
-
-void wxPlaylist::OnRemAll(wxCommandEvent &WXUNUSED(event)) 
-{
-       Clear();
-       RefreshList();
-       m_cur_entry = -1;
-       m_all_dead_entries = 1;
-}
-
-void wxPlaylist::OnRemDead(wxCommandEvent &WXUNUSED(event)) 
-{
-       for (u32 i=0; i<gf_list_count(m_entries); i++) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
-               if (!ple->m_bIsDead) continue;
-               gf_list_rem(m_entries, i);
-               i--;
-               delete ple;
-       }
-       m_all_dead_entries = gf_list_count(m_entries) ? 0 : 1;
-       RefreshList();
-}
-
-
-void wxPlaylist::OnSelUp(wxCommandEvent &WXUNUSED(event)) 
-{
-       s32 i;
-       if (!m_FileList->GetSelectedItemCount()) return;
-       long item = -1;
-       item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
-       if (item <= 0) return;
-       
-       item = -1;
-       for (;;) {
-        item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
-               if (item == -1) break;
-               PLEntry *ple = (PLEntry *) m_FileList->GetItemData(item);
-               i = gf_list_del_item(m_entries, ple);
-               assert(i>=1);
-               gf_list_insert(m_entries, ple, i-1);
-               ple->m_bIsSelected = 1;
-    }
-       RefreshList();
-}
-
-void wxPlaylist::OnSelDown(wxCommandEvent &WXUNUSED(event)) 
-{
-       s32 i;
-
-       if (!m_FileList->GetSelectedItemCount()) return;
-       long item = -1;
-       for (;;) {
-               item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
-               if (item == -1) break;
-       }
-       if ((u32) item + 1 == gf_list_count(m_entries)) return;
-       
-       item = -1;
-       for (;;) {
-        item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
-               if (item == -1) break;
-               PLEntry *ple = (PLEntry *) m_FileList->GetItemData(item);
-               i = gf_list_del_item(m_entries, ple);
-               assert(i>=1);
-               gf_list_insert(m_entries, ple, i+1);
-               ple->m_bIsSelected = 1;
-    }
-       RefreshList();
-}
-
-
-
-void wxPlaylist::OnSave(wxCommandEvent & WXUNUSED(event)) 
-{
-       Bool save_m3u;
-       char szPath[GF_MAX_PATH];
-       if (!gf_list_count(m_entries)) return;
-
-       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), wxT("M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|"), wxSAVE | wxCHANGE_DIR | wxOVERWRITE_PROMPT);
-       if (dlg.ShowModal() != wxID_OK) return;
-
-       strcpy(szPath, dlg.GetPath().mb_str(wxConvUTF8));
-       strlwr(szPath);
-       save_m3u = (dlg.GetFilterIndex()==0) ? 1 : 0;
-       if (save_m3u) {
-               if (!strstr(szPath, ".m3u")) {
-                       strcpy(szPath, dlg.GetPath().mb_str(wxConvUTF8));
-                       strcat(szPath, ".m3u");
-               } else {
-                       strcpy(szPath, dlg.GetPath().mb_str(wxConvUTF8));
-               }
-       } else {
-               if (!strstr(szPath, ".pls")) {
-                       strcpy(szPath, dlg.GetPath().mb_str(wxConvUTF8));
-                       strcat(szPath, ".pls");
-               } else {
-                       strcpy(szPath, dlg.GetPath().mb_str(wxConvUTF8));
-               }
-       }
-       Save(szPath, save_m3u);
-}
-
-void wxPlaylist::Save(char *szPath, Bool save_m3u)
-{
-       FILE *out = fopen(szPath, "wt");
-       if (!save_m3u) 
-               fprintf(out, "[playlist]\nNumberOfEntries=%d\n", gf_list_count(m_entries));
-
-       for (u32 i=0; i<gf_list_count(m_entries); i++) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
-               if (save_m3u) {
-                       fprintf(out, "%s\n", ple->m_url);
-               } else {
-                       fprintf(out, "File%d=%s\n", i+1, ple->m_url);
-                       fprintf(out, "Title%d=%s\n", i+1, ple->m_disp_name);
-                       if (ple->m_duration) fprintf(out, "Length%d=%d\n", i+1, ple->m_duration);
-                       else fprintf(out, "Length%d=-1\n", i+1);
-               }
-       }
-       if (!save_m3u) fprintf(out, "Version=2\n");
-
-       fprintf(out, "\n");
-       fclose(out);
-}
-
-void wxPlaylist::OnOpen(wxCommandEvent & WXUNUSED(event)) 
-{
-       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), wxT("M3U & PLS Playlists|*.m3u;*.pls|M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|"), wxOPEN | wxCHANGE_DIR/* | wxHIDE_READONLY*/);
-       if (dlg.ShowModal() != wxID_OK) return;
-
-       Clear();
-       OpenPlaylist(dlg.GetPath());
-       m_cur_entry = 0;
-       Play();
-}
-
-void wxPlaylist::OpenPlaylist(wxString filename)
-{
-       FILE *pl;
-       PLEntry *ple;
-       Bool load_m3u, go;
-       char szLine[GF_MAX_PATH];
-       pl = fopen(filename.mb_str(wxConvUTF8) , "rt");
-       if (!pl) return;
-
-       ple = NULL;
-       load_m3u = 1;
-       while (!feof(pl)) {
-               fgets(szLine, GF_MAX_PATH, pl);
-               go = 1;
-               while (go) {
-                       switch (szLine[strlen(szLine)-1]) {
-                       case '\n':
-                       case '\r':
-                       case ' ':
-                               szLine[strlen(szLine)-1] = 0;
-                               break;
-                       default:
-                               go = 0;
-                               break;
-                       }
-               }
-               if (!strlen(szLine)) continue;
-               if (!stricmp(szLine, "[playlist]")) {
-                       load_m3u = 0;
-               } else if (load_m3u) {
-                       ple = new PLEntry(wxString(szLine, wxConvUTF8) );
-                       gf_list_add(m_entries, ple);
-               } else if (!strnicmp(szLine, "file", 4)) {
-                       char *st = strchr(szLine, '=');
-                       if (!st) ple = NULL;
-                       else {
-                               ple = new PLEntry(wxString(st + 1, wxConvUTF8) );
-                               gf_list_add(m_entries, ple);
-                       }
-               } else if (ple && !strnicmp(szLine, "Length", 6)) {
-                       char *st = strchr(szLine, '=');
-                       s32 d = atoi(st + 1);
-                       if (d>0) ple->m_duration = d;
-               } else if (ple && !strnicmp(szLine, "Title", 5)) {
-                       char *st = strchr(szLine, '=');
-                       gf_free(ple->m_disp_name);
-                       ple->m_disp_name = gf_strdup(st + 6);
-               }
-       }
-       fclose(pl);
-       m_all_dead_entries = -1;
-       m_cur_entry = -1;
-       RefreshList();
-}
-
-void wxPlaylist::OnRightClick(wxListEvent & event) 
-{
-       if (!m_FileList->GetItemCount()) return;
-
-       wxMenu *popup = new wxMenu();   
-
-       if (m_FileList->GetSelectedItemCount()==1) {
-               popup->Append(ID_PL_PLAY, wxT("Play"));
-               popup->AppendSeparator();
-       }
-       popup->Append(ID_PL_SEL_REV, wxT("Inverse Selection"));
-       if (m_FileList->GetSelectedItemCount()) popup->Append(ID_PL_REM_FILE, wxT("Remove File(s)"));
-       if (m_FileList->GetItemCount()>1) {
-               popup->AppendSeparator();
-               popup->Append(ID_PL_SORT_TITLE, wxT("Sort By Title"));
-               popup->Append(ID_PL_SORT_FILE, wxT("Sort By File Name"));
-               popup->Append(ID_PL_SORT_DUR, wxT("Sort By Duration"));
-               popup->AppendSeparator();
-               popup->Append(ID_PL_REVERSE, wxT("Reverse List"));
-               popup->Append(ID_PL_RANDOMIZE, wxT("Randomize"));
-       }
-       
-       PopupMenu(popup, event.GetPoint());
-       delete popup;
-}
-
-void wxPlaylist::OnReverseSelection(wxCommandEvent &WXUNUSED(event) ) 
-{
-       u32 i;
-       long item = -1;
-       for (;;) {
-               item = m_FileList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
-               if (item == -1) break;
-               PLEntry *ple = (PLEntry *) m_FileList->GetItemData(item);
-               ple->m_bIsSelected = 1;
-       }
-       for (i=0; i<gf_list_count(m_entries); i++) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
-               ple->m_bIsSelected = !ple->m_bIsSelected;
-       }
-       RefreshList();
-}
-
-void wxPlaylist::OnReverseList(wxCommandEvent &WXUNUSED(event) )
-{
-       u32 count = gf_list_count(m_entries);
-       u32 hcount = count / 2;
-       count--;
-       for (u32 i=0; i<hcount; i++) {
-               PLEntry *ple1 = (PLEntry *) gf_list_get(m_entries, i);
-               PLEntry *ple2 = (PLEntry *) gf_list_get(m_entries, count-i);
-               gf_list_rem(m_entries, i);
-               gf_list_insert(m_entries, ple2, i);
-               gf_list_rem(m_entries, count-i);
-               gf_list_insert(m_entries, ple1, count-i);
-       }
-       RefreshList();
-}
-
-void wxPlaylist::OnRandomize(wxCommandEvent &WXUNUSED(event) )
-{
-       GF_List *new_entries = gf_list_new();
-
-       gf_rand_init(0);
-
-       while (gf_list_count(m_entries)>1) {
-               u32 pos = gf_rand() % (gf_list_count(m_entries)-1);
-               PLEntry *ple = (PLEntry *)gf_list_get(m_entries, pos);
-               gf_list_rem(m_entries, pos);
-               gf_list_add(new_entries, ple);
-       }
-       PLEntry *ple = (PLEntry *)gf_list_get(m_entries, 0);
-       gf_list_rem(m_entries, 0);
-       gf_list_add(new_entries, ple);
-
-       gf_list_del(m_entries);
-       m_entries = new_entries;
-       m_cur_entry = -1;
-       RefreshList();
-}
-
-void wxPlaylist::Sort(u32 type)
-{
-       u32 i, j, smallest;
-
-       for (i=0; i<gf_list_count(m_entries)-1; i++) {
-               smallest = i;
-               for (j=i+1; j<gf_list_count(m_entries); j++) {
-                       PLEntry *ple2 = (PLEntry *) gf_list_get(m_entries, smallest);
-                       PLEntry *ple1 = (PLEntry *) gf_list_get(m_entries, j);
-                       s32 test = 0;
-                       switch (type) {
-                       case 0:
-                test = stricmp(ple1->m_url, ple2->m_url);
-                               break;
-                       case 1:
-                test = stricmp(ple1->m_disp_name, ple2->m_disp_name);
-                               break;
-                       case 2:
-                test = ple1->m_duration - ple2->m_duration;
-                               break;
-                       }
-                       if (test<0) smallest = j;
-               }
-               PLEntry *ple = (PLEntry *)gf_list_get(m_entries, smallest);
-               gf_list_rem(m_entries, smallest);
-               gf_list_insert(m_entries, ple, i);
-       }
-       m_cur_entry = -1;
-       RefreshList();
-}
-
-void wxPlaylist::OnSortFile(wxCommandEvent &WXUNUSED(event) ) { Sort(0); }
-void wxPlaylist::OnSortTitle(wxCommandEvent &WXUNUSED(event) ) { Sort(1); }
-void wxPlaylist::OnSortDuration(wxCommandEvent &WXUNUSED(event) ) { Sort(2); }
-
-void wxPlaylist::RefreshCurrent()
-{
-       PLEntry *ple;
-       if (m_cur_entry<0) return;
-       ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       if (ple && ple->m_bIsPlaying) {
-               ple->m_bIsPlaying = 0;
-               UpdateEntry(m_cur_entry);
-       }
-}
-
-Bool wxPlaylist::HasValidEntries()
-{
-       u32 nb_dead = 0;
-       if (m_all_dead_entries==-1) {
-               for (u32 i=0; i<gf_list_count(m_entries); i++) {
-                       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, i);
-                       ple->m_bIsPlaying = 0;
-                       if (ple->m_bIsDead) nb_dead ++;
-               }
-               m_all_dead_entries = (nb_dead==gf_list_count(m_entries)) ? 1 : 0;
-       }
-       return !m_all_dead_entries;
-}
-
-void wxPlaylist::Play()
-{
-       PLEntry *ple;
-
-       if (!HasValidEntries()) return;
-
-       RefreshCurrent();
-
-       if (m_cur_entry >= (s32)gf_list_count(m_entries)) {
-               if (!m_pApp->m_loop) return;
-               m_cur_entry = 0;
-       }
-
-       ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       if (!ple || ple->m_bIsDead) {
-               m_cur_entry++;
-               Play();
-       } else {
-               char szPLE[20];
-               ple->m_bIsPlaying = 1;
-               UpdateEntry(m_cur_entry);
-               sprintf(szPLE, "%d", m_cur_entry);
-               gf_cfg_set_key(m_pApp->m_user.config, "General", "PLEntry", szPLE);
-               m_pApp->DoConnect();
-       }
-}
-
-void wxPlaylist::OnItemActivate(wxListEvent &WXUNUSED(event) ) 
-{
-       long item = m_FileList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
-       if (item==-1) return;
-       RefreshCurrent();
-       m_cur_entry = item;
-       Play();
-}
-
-
-void wxPlaylist::OnPlay(wxCommandEvent &WXUNUSED(event))
-{
-       long item = m_FileList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
-       if (item==-1) return;
-
-       RefreshCurrent();
-       m_cur_entry = item;
-       Play();
-}
-
-void wxPlaylist::Truncate()
-{
-       if (m_cur_entry<0) return;
-       while ((u32) m_cur_entry+1 < gf_list_count(m_entries)) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry+1);
-               gf_list_rem(m_entries, m_cur_entry+1);
-               delete ple;
-       }
-       RefreshList();
-}
-
-void wxPlaylist::QueueURL(wxString filename)
-{
-       char *ext = (char*)strrchr(filename.mb_str(wxConvUTF8), '.');
-       if (ext && (!stricmp(ext, ".m3u") || !stricmp(ext, ".pls")) ) {
-               OpenPlaylist(filename);
-       } else {
-               PLEntry *ple = new PLEntry(filename);
-               gf_list_add(m_entries, ple);
-       }
-}
-
-void wxPlaylist::PlayNext()
-{
-       RefreshCurrent();
-       if (1+m_cur_entry < (s32)gf_list_count(m_entries)) {
-               m_cur_entry++;
-               Play();
-       }
-}
-
-void wxPlaylist::PlayPrev()
-{
-       RefreshCurrent();
-       if (m_cur_entry>0) {
-               m_cur_entry--;
-               Play();
-       }
-}
-
-void wxPlaylist::SetDead()
-{
-       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       if (ple) {
-               ple->m_bIsDead = 1;
-               UpdateEntry(m_cur_entry);
-               if (ple->m_bIsPlaying) PlayNext();
-               m_all_dead_entries = -1;
-       }
-}
-void wxPlaylist::SetDuration(u32 duration)
-{
-       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       if (ple) {
-               ple->m_duration = duration;
-               UpdateEntry(m_cur_entry);
-       }
-}
-
-wxString wxPlaylist::GetDisplayName()
-{
-       if (m_cur_entry>=0) {
-               PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-               if (ple) return wxString(wxString(ple->m_disp_name, wxConvUTF8) );
-       }
-       return wxT("");
-}
-
-wxString wxPlaylist::GetURL()
-{
-       PLEntry *ple = (PLEntry *) gf_list_get(m_entries, m_cur_entry);
-       if (ple) return wxString(ple->m_url, wxConvUTF8);
-       return wxT("");
-}
-
diff --git a/applications/osmo4_wx/Playlist.h b/applications/osmo4_wx/Playlist.h
deleted file mode 100644 (file)
index 0ebb230..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) Jean Le Feuvre 2000-2005
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- *             
- */
-
-#ifndef _PLAYLIST_H
-#define _PLAYLIST_H
-
-#include "wx/wxprec.h"
-
-#ifndef WX_PRECOMP
-  #include "wx/wx.h"
-#endif
-
-#include "menubtn.h"
-
-enum
-{
-       ID_FILE_LIST = 1000,
-};
-
-class wxOsmo4Frame;
-
-class PLEntry 
-{
-public:
-       PLEntry(wxString url);
-       ~PLEntry();
-
-       char *m_url;
-       char *m_disp_name;
-       u32 m_duration;
-
-       Bool m_bIsSelected;
-       Bool m_bIsDead;
-       Bool m_bIsPlaying;
-};
-
-
-class wxPlaylist : public wxFrame
-{
-public:
-    wxPlaylist(wxWindow *parent);
-       virtual ~wxPlaylist();
-
-       void Clear();
-       void ClearButPlaying();
-       void RefreshList();
-
-       void Truncate();
-       void QueueURL(wxString filename);
-       void Play();
-       void PlayNext();
-       void PlayPrev();
-       void SetDead();
-       void SetDuration(u32 duration);
-       Bool HasValidEntries();
-       void OpenPlaylist(wxString fileName);
-
-       /*for current entry played*/
-       wxString GetDisplayName();
-       wxString GetURL();
-
-       s32 m_cur_entry;
-       GF_List *m_entries;
-
-       wxOsmo4Frame *m_pApp;
-
-private:
-       DECLARE_EVENT_TABLE()
-
-       void OnClose(wxCloseEvent &event);
-       void OnSize(wxSizeEvent &event);
-       void OnAddFile(wxCommandEvent &event);
-       void OnAddURL(wxCommandEvent &event);
-       void OnAddDir(wxCommandEvent &event);
-       void OnAddDirRec(wxCommandEvent &event);
-       void OnRemFile(wxCommandEvent &event);
-       void OnRemAll(wxCommandEvent &event);
-       void OnRemDead(wxCommandEvent &event);
-       void OnSelUp(wxCommandEvent &event);
-       void OnSelDown(wxCommandEvent &event);
-       void OnSave(wxCommandEvent &event);
-       void OnOpen(wxCommandEvent &event);
-       void OnRightClick(wxListEvent & event);
-       void OnReverseSelection(wxCommandEvent &event); 
-       void OnReverseList(wxCommandEvent &event);
-       void OnRandomize(wxCommandEvent &event);
-       void OnSortFile(wxCommandEvent &event);
-       void OnSortTitle(wxCommandEvent &event);
-       void OnSortDuration(wxCommandEvent &event);
-       void OnItemActivate(wxListEvent &event);
-       void OnPlay(wxCommandEvent &event);
-
-
-       void Sort(u32 type);
-       void UpdateEntry(u32 idx);
-       void RefreshCurrent();
-       void Save(char *szPath, Bool save_m3u);
-
-       wxBitmap *m_pOpen, *m_pSave, *m_pAdd, *m_pRem, *m_pUp, *m_pDown, *m_pSort;
-       wxMenuButton *m_pAddBut, *m_pRemBut, *m_pSortBut;
-       wxToolBar *m_pToolBar;
-       wxListCtrl *m_FileList;
-       char szCacheDir[GF_MAX_PATH];
-       s32 m_all_dead_entries;
-
-       void AddDir(Bool do_recurse);
-};
-
-
-
-#endif
-
diff --git a/applications/osmo4_wx/fileprops.cpp b/applications/osmo4_wx/fileprops.cpp
deleted file mode 100644 (file)
index 4697d55..0000000
+++ /dev/null
@@ -1,608 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) Jean Le Feuvre 2000-2005
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- *             
- */
-
-#include "fileprops.h"
-#include "wxOsmo4.h"
-#include "Playlist.h"
-#include <wx/filename.h>
-#include <gpac/modules/codec.h>
-#include <gpac/modules/service.h>
-#include <gpac/constants.h>
-/*ISO 639 languages*/
-#include <gpac/iso639.h>
-
-
-wxFileProps::wxFileProps(wxWindow *parent)
-             : wxDialog(parent, -1, wxString(_T("File Properties")))
-{
-
-       m_pApp = (wxOsmo4Frame *)parent;
-       SetSize(540, 260);
-       assert(m_pApp->m_pPlayList);
-
-       m_pTreeView = new wxTreeCtrl(this, ID_TREE_VIEW, wxPoint(4, 2), wxSize(200, 180), wxTR_DEFAULT_STYLE | wxSUNKEN_BORDER);
-       
-       new wxStaticText(this, 0, _T("Information"), wxPoint(210, 2), wxSize(60, 20));
-    m_pViewSel = new wxComboBox(this, ID_VIEW_SEL, _T(""), wxPoint(280, 2), wxSize(120, 24), 0, NULL, wxCB_READONLY);
-       m_pViewSel->Append(wxT("General"));
-       m_pViewSel->Append(wxT("Streams"));
-       m_pViewSel->Append(wxT("Playback"));
-       m_pViewSel->Append(wxT("Network"));
-       m_pViewSel->SetSelection(0);
-
-    m_pViewInfo = new wxTextCtrl(this, -1, wxT(""), wxPoint(210, 30), wxSize(320, 200), wxTE_MULTILINE | wxTE_READONLY | wxHSCROLL | wxSUNKEN_BORDER);
-
-#ifdef WIN32
-       m_pViewInfo->SetBackgroundColour(wxColour(wxT("LIGHT GREY")));
-#endif
-
-       m_pViewWI = new wxButton(this, ID_VIEW_WI, wxT("View World Info"), wxPoint(4, 174), wxSize(200, 40));
-       m_pViewSG = new wxButton(this, ID_VIEW_SG, wxT("View Scene Graph"), wxPoint(4, 220), wxSize(200, 40));
-
-
-       wxString str = m_pApp->m_pPlayList->GetDisplayName();
-       str += wxT(" Properties");
-       SetTitle(str);
-
-       m_pTimer = new wxTimer();
-       m_pTimer->SetOwner(this, ID_OD_TIMER);
-       m_pTimer->Start(500, 0);
-       RewriteODTree();
-
-}
-
-wxFileProps::~wxFileProps()
-{
-       m_pTimer->Stop();
-       delete m_pTimer;
-}
-
-
-BEGIN_EVENT_TABLE(wxFileProps, wxDialog)
-       EVT_TREE_ITEM_ACTIVATED(ID_TREE_VIEW, wxFileProps::OnSetSelection)
-       EVT_TREE_SEL_CHANGED(ID_TREE_VIEW, wxFileProps::OnSetSelection)
-       EVT_TREE_ITEM_EXPANDED(ID_TREE_VIEW, wxFileProps::OnSetSelection)
-       EVT_TREE_ITEM_COLLAPSED(ID_TREE_VIEW, wxFileProps::OnSetSelection)
-       EVT_TIMER(ID_OD_TIMER, wxFileProps::OnTimer)
-       EVT_BUTTON(ID_VIEW_SG, wxFileProps::OnViewSG)
-       EVT_BUTTON(ID_VIEW_WI, wxFileProps::OnViewWorld)
-       EVT_COMBOBOX(ID_VIEW_SEL, wxFileProps::OnSelectInfo)
-END_EVENT_TABLE()
-
-void wxFileProps::RewriteODTree()
-{
-       GF_ObjectManager *root_odm = gf_term_get_root_object(m_pApp->m_term);
-       if (!root_odm) return;
-
-       m_pTreeView->DeleteAllItems();
-       ODTreeData *root = new ODTreeData(root_odm);
-       m_pTreeView->AddRoot(wxT("Root OD"), -1, -1, root);
-       wxTreeItemId rootId = m_pTreeView->GetRootItem();
-
-       WriteInlineTree(root);
-       SetInfo(root_odm);
-}
-
-void wxFileProps::WriteInlineTree(ODTreeData *root)
-{
-       /*browse all ODs*/
-       u32 count = gf_term_get_object_count(m_pApp->m_term, root->m_pODMan);
-
-       for (u32 i=0; i<count; i++) {
-               GF_ObjectManager *odm = gf_term_get_object(m_pApp->m_term, root->m_pODMan, i);
-               if (!odm) return;
-               ODTreeData *odd = new ODTreeData(odm);
-               m_pTreeView->AppendItem(root->GetId(), wxT("Object Descriptor"), -1, -1, odd);
-
-               /*if inline propagate*/
-               switch (gf_term_object_subscene_type(m_pApp->m_term, odm)) {
-               case 1:
-                       m_pTreeView->SetItemText(odd->GetId(), wxT("Root Scene"));
-                       WriteInlineTree(odd);
-                       break;
-               case 2:
-                       m_pTreeView->SetItemText(odd->GetId(), wxT("Inline Scene"));
-                       WriteInlineTree(odd);
-                       break;
-               case 3:
-                       m_pTreeView->SetItemText(odd->GetId(), wxT("Extern Proto Lib"));
-                       break;
-               default:
-                       break;
-               }
-       }
-}
-
-void wxFileProps::OnSetSelection(wxTreeEvent& event)
-{
-       ODTreeData *odd = (ODTreeData *) m_pTreeView->GetItemData(event.GetItem());
-       SetInfo(odd->m_pODMan);
-}
-
-void wxFileProps::SetInfo(GF_ObjectManager *odm)
-{
-       m_current_odm = odm;
-
-       switch (m_pViewSel->GetSelection()) {
-       case 3: SetNetworkInfo(); break;
-       case 2: SetDecoderInfo(); break;
-       case 1: SetStreamsInfo(); break;
-       default: SetGeneralInfo(); break;
-       }
-}
-
-void wxFileProps::OnTimer(wxTimerEvent& WXUNUSED(event))
-{
-       switch (m_pViewSel->GetSelection()) {
-       case 2: SetDecoderInfo(); break;
-       }
-}
-void wxFileProps::OnSelectInfo(wxCommandEvent & WXUNUSED(event) )
-{
-       SetInfo(m_current_odm);
-}
-
-void wxFileProps::SetGeneralInfo()
-{
-       wxString info;
-       GF_MediaInfo odi;
-       u32 h, m, s;
-       u32 i, j;
-
-       info = wxT("");
-       m_pViewInfo->Clear();
-       m_pViewInfo->AppendText(info);
-
-       if (!m_current_odm || gf_term_get_object_info(m_pApp->m_term, m_current_odm, &odi) != GF_OK) return;
-
-       if (odi.has_profiles) info += wxT("Initial ");
-       info += wxString::Format(wxT("Object Descriptor ID %d\n"), odi.od->objectDescriptorID);
-       if (odi.duration) {
-               h = (u32) (odi.duration / 3600);
-               m = (u32) (odi.duration / 60) - h*60;
-               s = (u32) (odi.duration) - h*3600 - m*60;
-               info += wxString::Format(wxT("Duration %02d:%02d:%02d\n"), h, m, s);
-       } else {
-               info += wxT("Unknown duration\n");
-       }
-
-       if (odi.owns_service) {
-               info += wxT("Service Handler: ") + wxString(odi.service_handler, wxConvUTF8) + wxT("\n");
-               info += wxT("Service URL: ") + wxString(odi.service_url, wxConvUTF8) + wxT("\n");
-       }
-       
-       if (odi.od->URLString) {
-               info += wxT("Remote OD - URL: ") + wxString(odi.od->URLString, wxConvUTF8) + wxT("\n");
-       } 
-
-       if (odi.codec_name) {
-               switch (odi.od_type) {
-               case GF_STREAM_VISUAL:
-                       info += wxString::Format(wxT("Video Object: Width %d - Height %d\n"), odi.width, odi.height);
-                       info += wxT("Media Codec ") + wxString(odi.codec_name, wxConvUTF8) + wxT("\n");
-                       break;
-               case GF_STREAM_AUDIO:
-                       info += wxString::Format(wxT("Audio Object: Sample Rate %d - %d channels\n"), odi.sample_rate, odi.num_channels);
-                       info += wxT("Media Codec ") + wxString(odi.codec_name, wxConvUTF8) + wxT("\n");
-                       break;
-               case GF_STREAM_PRIVATE_SCENE:
-               case GF_STREAM_SCENE:
-                       if (odi.width && odi.height) {
-                               info += wxString::Format(wxT("Scene Description: Width %d - Height %d\n"), odi.width, odi.height);
-                       } else {
-                               info += wxT("Scene Description: No size specified\n");
-                       }
-                       info += wxT("Scene Codec ") + wxString(odi.codec_name, wxConvUTF8) + wxT("\n");
-                       break;
-               case GF_STREAM_TEXT:
-                       if (odi.width && odi.height) {
-                               info += wxString::Format(wxT("Text Object: Width %d - Height %d\n"), odi.width, odi.height);
-                       } else {
-                               info += wxString::Format(wxT("Text Object: No size specified\n"));
-                       }
-                       info += wxT("Text Codec ") + wxString(odi.codec_name, wxConvUTF8) + wxT("\n");
-                       break;
-               }
-       }
-       if (odi.protection==2) info += wxT("Encrypted Media NOT UNLOCKED"); 
-       else if (odi.protection==1) info += wxT("Encrypted Media"); 
-
-       if (!gf_list_count(odi.od->OCIDescriptors)) {
-               m_pViewInfo->Clear();
-               m_pViewInfo->AppendText(info);
-               return;
-       }
-
-       info += wxT("\nObject Content Information:\n");
-
-       /*check OCI (not everything interests us) - FIXME: support for unicode*/
-       for (i=0; i<gf_list_count(odi.od->OCIDescriptors); i++) {
-               GF_Descriptor *desc = (GF_Descriptor *) gf_list_get(odi.od->OCIDescriptors, i);
-               switch (desc->tag) {
-               case GF_ODF_SEGMENT_TAG:
-               {
-                       GF_Segment *sd = (GF_Segment *) desc;
-                       info += wxT("\nSegment Descriptor:\nName: ") + wxString((char *) sd->SegmentName, wxConvUTF8);
-                       info += wxString::Format(wxT(" - start time %g sec - duration %g sec\n"), sd->startTime, sd->Duration);
-               }
-                       break;
-               case GF_ODF_CC_NAME_TAG:
-               {
-                       GF_CC_Name *ccn = (GF_CC_Name *)desc;
-                       info += wxT("\nContent Creators:\n");
-                       for (j=0; j<gf_list_count(ccn->ContentCreators); j++) {
-                               GF_ContentCreatorInfo *ci = (GF_ContentCreatorInfo *) gf_list_get(ccn->ContentCreators, j);
-                               if (!ci->isUTF8) continue;
-                               info += wxT("\t") + wxString(ci->contentCreatorName, wxConvUTF8) + wxT("\n");
-                       }
-               }
-                       break;
-
-               case GF_ODF_SHORT_TEXT_TAG:
-                       {
-                               GF_ShortTextual *std = (GF_ShortTextual *)desc;
-                               info += wxT("\n") + wxString(std->eventName, wxConvUTF8) + wxT(": ") + wxString(std->eventText, wxConvUTF8) + wxT("\n");
-                       }
-                       break;
-               /*todo*/
-               case GF_ODF_CC_DATE_TAG:
-                       break;
-               default:
-                       break;
-               }
-
-       }
-
-       m_pViewInfo->Clear();
-       m_pViewInfo->AppendText(info);
-}
-
-void wxFileProps::SetStreamsInfo()
-{
-       u32 i, count;
-       wxString info;
-       GF_MediaInfo odi;
-       char code[5];
-
-       info = wxT("");
-       m_pViewInfo->Clear();
-       m_pViewInfo->AppendText(info);
-
-       if (!m_current_odm || gf_term_get_object_info(m_pApp->m_term, m_current_odm, &odi) != GF_OK) return;
-
-       if (odi.has_profiles) {
-               info += wxString::Format(wxT("\tOD Profile@Level %d\n"), odi.OD_pl);
-               info += wxString::Format(wxT("\tScene Profile@Level %d\n"), odi.scene_pl);
-               info += wxString::Format(wxT("\tGraphics Profile@Level %d\n"), odi.graphics_pl);
-               info += wxString::Format(wxT("\tAudio Profile@Level %d\n"), odi.audio_pl);
-               info += wxString::Format(wxT("\tVisual Profile@Level %d\n"), odi.scene_pl);
-               if (odi.inline_pl) info += wxT("\tInline Content use same profiles\n");
-               info += wxT("\n");
-       }
-
-       count = gf_list_count(odi.od->ESDescriptors);
-
-       for (i=0; i<count; i++) {
-               GF_ESD *esd = (GF_ESD *) gf_list_get(odi.od->ESDescriptors, i);
-               
-               info += wxString::Format(wxT("Stream ID %d - Clock ID %d\n"), esd->ESID, esd->OCRESID);
-               if (esd->dependsOnESID) {
-                       info += wxString::Format(wxT("\tDepends on Stream ID %d for decoding\n"), esd->dependsOnESID);
-               }
-               switch (esd->decoderConfig->streamType) {
-               case GF_STREAM_OD:
-                       info += wxString::Format(wxT("\tOD Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
-                       break;
-               case GF_STREAM_OCR:
-                       info += wxT("\tObject Clock Reference Stream\n");
-                       break;
-               case GF_STREAM_SCENE:
-                       info += wxString::Format(wxT("\tScene Description Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
-                       break;
-               case GF_STREAM_PRIVATE_SCENE:
-                       info += wxString::Format(wxT("\tGPAC Private Scene Description Stream\n"));
-                       break;
-               case GF_STREAM_VISUAL:
-                       info += wxT("\tVisual Stream - media type: ");
-                       switch (esd->decoderConfig->objectTypeIndication) {
-                       case GPAC_OTI_VIDEO_MPEG4_PART2: info += wxT("MPEG-4\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SIMPLE: info += wxT("MPEG-2 Simple Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_MAIN: info += wxT("MPEG-2 Main Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SNR: info += wxT("MPEG-2 SNR Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_SPATIAL: info += wxT("MPEG-2 Spatial Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_HIGH: info += wxT("MPEG-2 High Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG2_422: info += wxT("MPEG-2 422 Profile\n"); break;
-                       case GPAC_OTI_VIDEO_MPEG1: info += wxT("MPEG-1\n"); break;
-                       case GPAC_OTI_IMAGE_JPEG: info += wxT("JPEG\n"); break;
-                       case GPAC_OTI_IMAGE_PNG: info += wxT("PNG\n"); break;
-                       case GPAC_OTI_IMAGE_JPEG_2000: info += wxT("JPEG2000\n"); break;
-                       case 0x80:
-                               memcpy(code, esd->decoderConfig->decoderSpecificInfo->data, 4);
-                               code[4] = 0;
-                               info += wxT("GPAC Intern (") + wxString(code, wxConvUTF8) + wxT(")\n");
-                               break;
-                       default: 
-                               info += wxString::Format(wxT("Private/Unknown Type (0x%x)\n"), esd->decoderConfig->objectTypeIndication); 
-                               break;
-                       }
-                       break;
-
-               case GF_STREAM_AUDIO:
-                       info += wxT("\tAudio Stream - media type: ");
-                       switch (esd->decoderConfig->objectTypeIndication) {
-                       case GPAC_OTI_AUDIO_AAC_MPEG4: info += wxT("MPEG-4\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_MP: info += wxT("MPEG-2 AAC Main Profile\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_LCP: info += wxT("MPEG-2 AAC LowComplexity Profile\n"); break;
-                       case GPAC_OTI_AUDIO_AAC_MPEG2_SSRP: info += wxT("MPEG-2 AAC Scalable Sampling Rate Profile\n"); break;
-                       case GPAC_OTI_AUDIO_MPEG2_PART3: info += wxT("MPEG-2 Audio\n"); break;
-                       case GPAC_OTI_AUDIO_MPEG1: info += wxT("MPEG-1 Audio\n"); break;
-                       case 0xA0: info += wxT("EVRC Audio\n"); break;
-                       case 0xA1: info += wxT("SMV Audio\n"); break;
-                       case 0xE1: info += wxT("QCELP Audio\n"); break;
-                       case 0x80:
-                               memcpy(code, esd->decoderConfig->decoderSpecificInfo->data, 4);
-                               code[4] = 0;
-                               info += wxT("GPAC Intern (") + wxString(code, wxConvUTF8) + wxT(")\n");
-                               break;
-                       default: 
-                               info += wxString::Format(wxT("Private/Unknown Type (0x%x)\n"), esd->decoderConfig->objectTypeIndication); 
-                               break;
-                       }
-                       break;
-               case GF_STREAM_MPEG7:
-                       info += wxString::Format(wxT("\tMPEG-7 Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
-                       break;
-               case GF_STREAM_IPMP:
-                       info += wxString::Format(wxT("\tIPMP Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
-                       break;
-               case GF_STREAM_OCI:
-                       info += wxString::Format(wxT("\tOCI Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
-                       break;
-               case GF_STREAM_MPEGJ:
-                       info += wxString::Format(wxT("\tMPEGJ Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
-                       break;
-               case GF_STREAM_INTERACT:
-                       info += wxString::Format(wxT("\tUser Interaction Stream - version %d\n"), esd->decoderConfig->objectTypeIndication);
-                       break;
-               default:
-                       info += wxT("Private/Unknown\n");
-                       break;
-               }
-
-               info += wxString::Format(wxT("\tBuffer Size %d\n\tAverage Bitrate %d bps\n\tMaximum Bitrate %d bps\n"), esd->decoderConfig->bufferSizeDB, esd->decoderConfig->avgBitrate, esd->decoderConfig->maxBitrate);
-               if (esd->slConfig->predefined==SLPredef_SkipSL) {
-                       info += wxString::Format(wxT("\tNot using MPEG-4 Synchronization Layer\n"));
-               } else {
-                       info += wxString::Format(wxT("\tStream Clock Resolution %d\n"), esd->slConfig->timestampResolution);
-               }
-               if (esd->URLString) 
-                       info += wxT("\tStream Location: ") + wxString(esd->URLString, wxConvUTF8) + wxT("\n");
-
-               /*check language*/
-               if (esd->langDesc) {
-                       u32 i=0;
-                       char lan[4], *szLang;
-                       lan[0] = esd->langDesc->langCode>>16;
-                       lan[1] = (esd->langDesc->langCode>>8)&0xFF;
-                       lan[2] = (esd->langDesc->langCode)&0xFF;
-                       lan[3] = 0;
-
-                       if ((lan[0]=='u') && (lan[1]=='n') && (lan[2]=='d')) szLang = (char*) "Undetermined";
-                       else {
-                               szLang = lan;
-                               while (GF_ISO639_Lang[i]) {
-                                       if (GF_ISO639_Lang[i+2][0] && strstr(GF_ISO639_Lang[i+1], lan)) {
-                                               szLang = (char*) GF_ISO639_Lang[i];
-                                               break;
-                                       }
-                                       i+=3;
-                               }
-                       }
-                       info += wxString::Format(wxT("\tStream Language: %s\n"), szLang);
-               }
-
-       }
-       m_pViewInfo->Clear();
-       m_pViewInfo->AppendText(info);
-}
-
-
-void wxFileProps::SetDecoderInfo()
-{
-       GF_MediaInfo odi;
-       wxString info;
-       u32 h, m, s;
-
-       if (!m_current_odm || gf_term_get_object_info(m_pApp->m_term, m_current_odm, &odi)) {
-         m_pViewInfo->Clear();
-         m_pViewInfo->AppendText(info);
-         return;
-       }
-
-       info = wxT("Status: ");
-       switch (odi.status) {
-       case 0:
-       case 1:
-       case 2:
-               h = (u32) (odi.current_time / 3600);
-               m = (u32) (odi.current_time / 60) - h*60;
-               s = (u32) (odi.current_time) - h*3600 - m*60;
-               if (odi.status==0) info += wxT("Stopped");
-               else if (odi.status==1) info += wxT("Playing");
-               else info += wxT("Paused");
-               info += wxString::Format(wxT("\nObject Time: %02d:%02d:%02d\n"), h, m, s);
-               break;
-       case 3:
-               info += wxT("Not Setup\n");
-               m_pViewInfo->Clear();
-               m_pViewInfo->AppendText(info);
-               return;
-       default:
-               info += wxT("Setup Failed\n");
-               m_pViewInfo->Clear();
-               m_pViewInfo->AppendText(info);
-               return;
-       }
-       /*get clock drift*/
-       info += wxString::Format(wxT("Clock drift: %d ms\n"), odi.clock_drift);
-       /*get buffering*/
-       if (odi.buffer>=0) info += wxString::Format(wxT("Buffering Time: %d ms\n"), odi.buffer);
-       else if (odi.buffer==-1) info += wxT("Not buffering\n");
-       else info += wxT("Not Playing\n");
-
-       /*get DB occupation*/
-       if (odi.buffer>=0) info += wxString::Format(wxT("Decoding Buffer: %d Access Units\n"), odi.db_unit_count);
-       /*get CB occupation*/
-       if (odi.cb_max_count) 
-               info += wxString::Format(wxT("Composition Memory: %d/%d Units\n"), odi.cb_unit_count, odi.cb_max_count);
-
-       Float avg_dec_time = 0;
-       if (odi.nb_dec_frames) {
-               avg_dec_time = (Float) odi.total_dec_time; 
-               avg_dec_time /= odi.nb_dec_frames; 
-       }
-       info += wxString::Format(wxT("Average Bitrate %d kbps (%d max)\nAverage Decoding Time %.2f ms (%d max)\nTotal decoded frames %d - %d dropped\n"),
-                                                               (u32) odi.avg_bitrate/1024, odi.max_bitrate/1024, avg_dec_time, odi.max_dec_time, odi.nb_dec_frames, odi.nb_droped);
-
-       m_pViewInfo->Clear();
-       m_pViewInfo->AppendText(info);
-}
-
-void wxFileProps::SetNetworkInfo()
-{
-       wxString info;
-       u32 id;
-       NetStatCommand com;
-       GF_MediaInfo odi;
-       u32 d_enum;
-       GF_Err e;
-
-       info = wxT("");
-       m_pViewInfo->Clear();
-       m_pViewInfo->AppendText(wxT(""));
-
-       if (!m_current_odm || gf_term_get_object_info(m_pApp->m_term, m_current_odm, &odi) != GF_OK) return;
-
-       if (odi.owns_service) {
-               const char *url, *path;
-               u32 done, total, bps;
-               info = wxT("Current Downloads in service:\n");
-               d_enum = 0;
-               while (gf_term_get_download_info(m_pApp->m_term, m_current_odm, &d_enum, &url, &path, &done, &total, &bps)) {
-                       info += wxString(url, wxConvUTF8);
-                       if (total) {
-                               info += wxString::Format(wxT(": %d / %d bytes (%.2f %%) - %.2f kBps\n"), done, total, (100.0*done)/total, ((Double)bps)/1024);
-                       } else {
-                               info += wxString::Format(wxT(": %.2f kBps\n"), ((Double)bps)/1024);
-                       }
-               }
-               if (!d_enum) info = wxT("No Downloads in service\n");
-               info += wxT("\n");
-       }
-
-       d_enum = 0;
-       while (gf_term_get_channel_net_info(m_pApp->m_term, m_current_odm, &d_enum, &id, &com, &e)) {
-               if (e) continue;
-               if (!com.bw_down && !com.bw_up) continue;
-
-               info += wxString::Format(wxT("Stream ID %d statistics:\n"), id);
-               if (com.multiplex_port) {
-                       info += wxString::Format(wxT("\tMultiplex Port %d - multiplex ID %d\n"), com.multiplex_port, com.port);
-               } else {
-                       info += wxString::Format(wxT("\tPort %d\n"), com.port);
-               }
-               info += wxString::Format(wxT("\tPacket Loss Percentage: %.4f\n"), com.pck_loss_percentage);
-               info += wxString::Format(wxT("\tDown Bandwidth: %.3f bps\n"), ((Float)com.bw_down)/1024);
-               if (com.bw_up) info += wxString::Format(wxT("\tUp Bandwidth: %d bps\n"), com.bw_up);
-               if (com.ctrl_port) {
-                       if (com.multiplex_port) {
-                               info += wxString::Format(wxT("\tControl Multiplex Port: %d - Control Multiplex ID %d\n"), com.multiplex_port, com.ctrl_port);
-                       } else {
-                               info += wxString::Format(wxT("\tControl Port: %d\n"), com.ctrl_port);
-                       }
-                       info += wxString::Format(wxT("\tControl Down Bandwidth: %d bps\n"), com.ctrl_bw_down);
-                       info += wxString::Format(wxT("\tControl Up Bandwidth: %d bps\n"), com.ctrl_bw_up);
-               }
-               info += wxT("\n");
-       }
-       m_pViewInfo->Clear();
-       m_pViewInfo->AppendText(info);
-}
-
-
-void wxFileProps::OnViewWorld(wxCommandEvent &WXUNUSED(event)) 
-{
-       wxString wit;
-       const char *str;
-       GF_List *descs;
-       descs = gf_list_new();
-       str = gf_term_get_world_info(m_pApp->m_term, m_current_odm, descs);
-
-       if (!str) {
-               wxMessageDialog(this, wxT("No World Info available"), wxT("Sorry!"), wxOK).ShowModal();
-               return;
-       }
-
-       wit = wxT("");
-       for (u32 i=0; gf_list_count(descs); i++) {
-               const char *d = (const char *) gf_list_get(descs, i);
-               wit += wxString(d, wxConvUTF8);
-               wit += wxT("\n");
-       }
-       wxMessageDialog(this, wit, wxString(str, wxConvUTF8), wxOK).ShowModal();
-       gf_list_del(descs);
-}
-
-void wxFileProps::OnViewSG(wxCommandEvent &WXUNUSED(event)) 
-{
-       const char *sOpt;
-       Bool dump_xmt;
-       wxFileName out_file;
-       char szOutFile[GF_MAX_PATH];
-       wxString fname;
-
-       sOpt = gf_cfg_get_key(m_pApp->m_user.config, "General", "CacheDirectory");
-       out_file.AssignDir(wxString(sOpt, wxConvUTF8) );
-
-       sOpt = gf_cfg_get_key(m_pApp->m_user.config, "General", "ViewXMT");
-       out_file.SetFullName(wxT("scene_dump"));
-       if (sOpt && !stricmp(sOpt, "yes")) {
-               dump_xmt = 1;
-       } else {
-               dump_xmt = 0;
-       }
-       strcpy(szOutFile, out_file.GetFullName().mb_str(wxConvUTF8));
-
-       GF_Err e = gf_term_dump_scene(m_pApp->m_term, szOutFile, NULL, dump_xmt, 0, m_current_odm);
-       if (e) {
-               wxMessageDialog dlg(this, wxString(gf_error_to_string(e), wxConvUTF8), wxT("Error while dumping"), wxOK);
-               dlg.ShowModal();
-       } else {
-               wxString cmd = get_pref_browser(m_pApp->m_user.config);
-               cmd += wxT(" ");
-               cmd += wxString(szOutFile, wxConvUTF8);
-               wxExecute(cmd);
-       }
-}
diff --git a/applications/osmo4_wx/fileprops.h b/applications/osmo4_wx/fileprops.h
deleted file mode 100644 (file)
index a1ba51b..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) Jean Le Feuvre 2000-2005
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- *             
- */
-
-#ifndef _FILEPROPS_H
-#define _FILEPROPS_H
-
-#include "wx/wxprec.h"
-
-#ifndef WX_PRECOMP
-  #include "wx/wx.h"
-#endif
-
-#include <wx/treectrl.h>
-
-#include <gpac/terminal.h>
-
-/*abstract class for all items in the tree*/
-class ODTreeData : public wxTreeItemData
-{
-public:
-       ODTreeData(GF_ObjectManager *odm) : wxTreeItemData(), m_pODMan(odm) {}
-       GF_ObjectManager *m_pODMan;
-};
-
-
-class wxOsmo4Frame;
-class wxFileProps : public wxDialog 
-{
-public:
-    wxFileProps(wxWindow *parent);
-    virtual ~wxFileProps();
-
-private:
-       DECLARE_EVENT_TABLE()
-
-       wxOsmo4Frame *m_pApp;
-
-       wxTreeCtrl *m_pTreeView;
-       wxTextCtrl *m_pViewInfo;
-       wxComboBox *m_pViewSel;
-       wxButton *m_pViewWI, *m_pViewSG;
-       wxTimer *m_pTimer;
-
-       GF_ObjectManager *m_current_odm;
-
-       void RewriteODTree();
-       void SetGeneralInfo();
-       void SetStreamsInfo();
-       void SetDecoderInfo();
-       void SetNetworkInfo();
-       void WriteInlineTree(ODTreeData *pRoot);
-       void OnSetSelection(wxTreeEvent &event);
-       void OnSelectInfo(wxCommandEvent &event);
-       void OnTimer(wxTimerEvent &event);
-       void OnViewWorld(wxCommandEvent &event);
-       void OnViewSG(wxCommandEvent &event);
-       void SetInfo(GF_ObjectManager *odm);
-};
-
-#endif
-
diff --git a/applications/osmo4_wx/menubtn.cpp b/applications/osmo4_wx/menubtn.cpp
deleted file mode 100644 (file)
index a13e58c..0000000
+++ /dev/null
@@ -1,863 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name:        wxMenuButton
-// Purpose:     A button with a dropdown wxMenu
-// Author:      John Labenski
-// Modified by:
-// Created:     11/05/2002
-// RCS-ID:
-// Copyright:   (c) John Labenki
-// Licence:     wxWidgets licence
-/////////////////////////////////////////////////////////////////////////////
-
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "menubtn.h"
-#endif
-
-// For compilers that support precompilation, includes "wx/wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-    #pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-    #include "wx/control.h"
-    #include "wx/menu.h"
-    #include "wx/settings.h"
-    #include "wx/bitmap.h"
-    #include "wx/pen.h"
-    #include "wx/dc.h"
-#endif // WX_PRECOMP
-
-#include <wx/tglbtn.h>
-#include <wx/dcclient.h>
-#include <wx/timer.h>
-#include <wx/image.h>
-
-#include "menubtn.h"
-
-
-
-// ==========================================================================
-// wxCustomButton
-// ==========================================================================
-IMPLEMENT_DYNAMIC_CLASS( wxCustomButton, wxControl )
-
-BEGIN_EVENT_TABLE(wxCustomButton,wxControl)
-    EVT_MOUSE_EVENTS ( wxCustomButton::OnMouseEvents )
-    EVT_PAINT        ( wxCustomButton::OnPaint )
-    EVT_SIZE         ( wxCustomButton::OnSize )
-END_EVENT_TABLE()
-
-wxCustomButton::~wxCustomButton()
-{
-    if (HasCapture()) ReleaseMouse();
-    if (m_timer) delete m_timer;
-}
-
-void wxCustomButton::Init()
-{
-    m_focused = FALSE;
-    m_labelMargin = wxSize(4,4);
-    m_bitmapMargin = wxSize(2,2);
-    m_down = 0;
-    m_timer = NULL;
-    m_eventType = 0;
-    m_button_style = wxCUSTBUT_TOGGLE|wxCUSTBUT_BOTTOM;
-}
-
-bool wxCustomButton::Create(wxWindow* parent, wxWindowID id,
-                            const wxString& label, const wxBitmap &bitmap,
-                            const wxPoint& pos, const wxSize& size,
-                            long style, const wxValidator& val,
-                            const wxString& name)
-{
-    if (!wxControl::Create(parent,id,pos,size,wxNO_BORDER|wxCLIP_CHILDREN,val,name))
-        return FALSE;
-    
-    wxControl::SetLabel(label);    
-    wxControl::SetBackgroundColour(parent->GetBackgroundColour());
-    wxControl::SetForegroundColour(parent->GetForegroundColour());
-    wxControl::SetFont(parent->GetFont());
-
-    if (bitmap.Ok()) m_bmpLabel = bitmap;
-    
-    if (!SetButtonStyle(style)) return FALSE;
-
-    wxSize bestSize = DoGetBestSize();
-    SetSize(wxSize(size.x<0 ? bestSize.x:size.x, size.y<0 ? bestSize.y:size.y));
-#if (wxMINOR_VERSION<8) 
-    SetBestSize(GetSize());
-#else
-    SetInitialSize(GetSize());
-#endif
-    
-    CalcLayout(TRUE);
-    return TRUE;
-}
-
-void wxCustomButton::SetValue(bool depressed)
-{
-    wxCHECK_RET(!(m_button_style & wxCUSTBUT_NOTOGGLE), wxT("can't set button state"));
-    m_down = depressed ? 1 : 0;
-    Refresh(FALSE);
-}
-
-bool wxCustomButton::SetButtonStyle(long style)
-{
-    int n_styles = 0;
-    if ((style & wxCUSTBUT_LEFT) != 0)   n_styles++;
-    if ((style & wxCUSTBUT_RIGHT) != 0)  n_styles++;
-    if ((style & wxCUSTBUT_TOP) != 0)    n_styles++;
-    if ((style & wxCUSTBUT_BOTTOM) != 0) n_styles++;
-    wxCHECK_MSG(n_styles < 2, FALSE, wxT("Only one wxCustomButton label position allowed"));
-    
-    n_styles = 0;
-    if ((style & wxCUSTBUT_NOTOGGLE) != 0)       n_styles++;
-    if ((style & wxCUSTBUT_BUTTON) != 0)         n_styles++;
-    if ((style & wxCUSTBUT_TOGGLE) != 0)         n_styles++;
-    if ((style & wxCUSTBUT_BUT_DCLICK_TOG) != 0) n_styles++;
-    if ((style & wxCUSTBUT_TOG_DCLICK_BUT) != 0) n_styles++;
-    wxCHECK_MSG(n_styles < 2, FALSE, wxT("Only one wxCustomButton style allowed"));
-
-    m_button_style = style;
-    
-    if ((m_button_style & wxCUSTBUT_BUTTON) != 0) 
-        m_down = 0;
-    
-    CalcLayout(TRUE);
-    return TRUE;
-}
-
-void wxCustomButton::SetLabel( const wxString &label )
-{
-    wxControl::SetLabel(label);
-    CalcLayout(TRUE);
-}
-
-// sequence of events in GTK is up, dclick, up.
-
-void wxCustomButton::OnMouseEvents(wxMouseEvent& event)
-{
-    if (m_button_style & wxCUSTBUT_NOTOGGLE) return;
-    
-    if (event.LeftDown() || event.RightDown())
-    {
-        if (!HasCapture()) 
-            CaptureMouse(); // keep depressed until up
-        
-        m_down++;
-        Redraw();
-    }
-    else if (event.LeftDClick() || event.RightDClick())
-    {
-        m_down++; // GTK eats second down event
-        Redraw();
-    }
-    else if (event.LeftUp())
-    {
-        if (HasCapture()) 
-            ReleaseMouse();
-        
-        m_eventType = wxEVT_LEFT_UP;
-        
-#if (wxMINOR_VERSION<8) 
-        if (wxRect(wxPoint(0,0), GetSize()).Inside(event.GetPosition()))
-#else
-        if (wxRect(wxPoint(0,0), GetSize()).Contains(event.GetPosition()))
-#endif
-        {
-            if ((m_button_style & wxCUSTBUT_BUTTON) && (m_down > 0))
-            {
-                m_down = 0;
-                Redraw();
-                SendEvent();
-                return;
-            }
-            else
-            {
-                if (!m_timer)
-                {
-                    m_timer = new wxTimer(this, m_down+1);
-                    m_timer->Start(200, TRUE);
-                }
-                else
-                {
-                    m_eventType = wxEVT_LEFT_DCLICK;
-                }
-                
-                if ((m_button_style & wxCUSTBUT_TOGGLE) && 
-                    (m_button_style & wxCUSTBUT_TOG_DCLICK_BUT)) m_down++;
-            }
-        }
-
-        Redraw();
-    }
-    else if (event.RightUp())
-    {
-        if (HasCapture()) 
-            ReleaseMouse();
-        
-        m_eventType = wxEVT_RIGHT_UP;
-
-#if (wxMINOR_VERSION<8) 
-        if (wxRect(wxPoint(0,0), GetSize()).Inside(event.GetPosition()))
-#else
-        if (wxRect(wxPoint(0,0), GetSize()).Contains(event.GetPosition()))
-#endif
-        {
-            if ((m_button_style & wxCUSTBUT_BUTTON) && (m_down > 0))
-            {
-                m_down = 0;
-                Redraw();
-                SendEvent();
-                return;
-            }
-            else
-            {
-                m_down++;
-            
-                if (!m_timer)
-                {
-                    m_timer = new wxTimer(this, m_down);
-                    m_timer->Start(250, TRUE);
-                }
-                else
-                {
-                    m_eventType = wxEVT_RIGHT_DCLICK;
-                }
-            }
-        }
-        
-        Redraw();
-    }
-    else if (event.Entering())
-    {
-        m_focused = TRUE;
-        if ((event.LeftIsDown() || event.RightIsDown()) && HasCapture()) 
-            m_down++;
-        
-        Redraw();
-    }
-    else if (event.Leaving())
-    {
-        m_focused = FALSE;
-        if ((event.LeftIsDown() || event.RightIsDown()) && HasCapture())
-            m_down--;
-        
-        Redraw();
-    }
-}
-
-
-
-void wxCustomButton::SendEvent()
-{
-    if (((m_button_style & wxCUSTBUT_TOGGLE) && (m_eventType == wxEVT_LEFT_UP)) || 
-        ((m_button_style & wxCUSTBUT_BUT_DCLICK_TOG) && (m_eventType == wxEVT_LEFT_DCLICK)) ||
-        ((m_button_style & wxCUSTBUT_TOG_DCLICK_BUT) && (m_eventType == wxEVT_LEFT_UP)))
-    {
-        wxCommandEvent eventOut(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, GetId());
-        eventOut.SetInt(m_down%2 ? 1 : 0);
-        eventOut.SetExtraLong(m_eventType);
-        eventOut.SetEventObject(this);
-        GetEventHandler()->ProcessEvent(eventOut);
-    }
-    else
-    {
-        wxCommandEvent eventOut(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
-        eventOut.SetInt(0);
-        eventOut.SetExtraLong(m_eventType);
-        eventOut.SetEventObject(this);
-        GetEventHandler()->ProcessEvent(eventOut);
-    }
-}
-
-wxBitmap wxCustomButton::CreateBitmapDisabled(const wxBitmap &bitmap) const
-{    
-    wxCHECK_MSG(bitmap.Ok(), wxNullBitmap, wxT("invalid bitmap"));
-    
-    unsigned char br = GetBackgroundColour().Red();
-    unsigned char bg = GetBackgroundColour().Green();
-    unsigned char bb = GetBackgroundColour().Blue();
-        
-    wxImage image = bitmap.ConvertToImage();
-    int pos, width = image.GetWidth(), height = image.GetHeight();
-    unsigned char *img_data = image.GetData();
-
-    for (int j=0; j<height; j++)
-    {
-        for (int i=j%2; i<width; i+=2)
-        {   
-            pos = (j*width+i)*3;
-            img_data[pos  ] = br; 
-            img_data[pos+1] = bg; 
-            img_data[pos+2] = bb; 
-        }
-    }
-        
-    return wxBitmap(image);
-}
-
-void wxCustomButton::SetBitmapLabel(const wxBitmap& bitmap)
-{ 
-    m_bmpLabel = bitmap; 
-    CalcLayout(TRUE); 
-}
-
-void wxCustomButton::OnPaint(wxPaintEvent& WXUNUSED(event))
-{
-    wxPaintDC dc(this);
-    Paint(dc);
-}
-
-void wxCustomButton::Redraw()
-{
-    wxClientDC dc(this);
-    Paint(dc);
-}
-
-void wxCustomButton::Paint( wxDC &dc )
-{
-#if (wxMINOR_VERSION<8) 
-    dc.BeginDrawing();
-#endif
-
-    int w, h;
-    GetSize(&w,&h);
-    wxColour foreColour = GetForegroundColour();
-    wxColour backColour = GetBackgroundColour();
-
-    if (m_focused)
-    {
-        backColour.Set( wxMin(backColour.Red()   + 20, 255),
-                        wxMin(backColour.Green() + 20, 255),
-                        wxMin(backColour.Blue()  + 20, 255) );
-    }
-
-    wxBitmap bitmap;
-    
-    if (IsEnabled())
-    {
-        if (GetValue() && m_bmpSelected.Ok()) 
-            bitmap = m_bmpSelected;
-        else if (m_focused && m_bmpFocus.Ok()) 
-            bitmap = m_bmpFocus;
-        else if (m_bmpLabel.Ok())  
-            bitmap = m_bmpLabel;
-    }
-    else
-    {
-        // try to create disabled if it doesn't exist
-        if (!m_bmpDisabled.Ok() && m_bmpLabel.Ok())
-            m_bmpDisabled = CreateBitmapDisabled(m_bmpLabel);
-
-        if (m_bmpDisabled.Ok())
-            bitmap = m_bmpDisabled;
-        else if (m_bmpLabel.Ok()) 
-            bitmap = m_bmpLabel;
-
-        foreColour = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
-    }
-
-    wxBrush brush(backColour, wxSOLID);
-    dc.SetBackground(brush);
-    dc.SetBrush(brush);
-    dc.SetPen(*wxTRANSPARENT_PEN);
-
-    dc.DrawRectangle(0, 0, w, h);
-
-    if (bitmap.Ok()) 
-        dc.DrawBitmap(bitmap, m_bitmapPos.x, m_bitmapPos.y, TRUE );
-
-    if (!GetLabel().IsEmpty())
-    {
-        dc.SetFont(GetFont());
-        dc.SetTextBackground(backColour);
-        dc.SetTextForeground(foreColour);
-        dc.DrawText(GetLabel(), m_labelPos.x, m_labelPos.y);
-    }
-    
-    if (GetValue())                                        // draw sunken border
-    {
-        dc.SetPen(*wxGREY_PEN);
-        dc.DrawLine(0,h-1,0,0);     dc.DrawLine(0,0,w,0);
-        dc.SetPen(*wxWHITE_PEN);
-        dc.DrawLine(w-1,1,w-1,h-1); dc.DrawLine(w-1,h-1,0,h-1);
-        dc.SetPen(*wxBLACK_PEN);
-        dc.DrawLine(1,h-2,1,1);     dc.DrawLine(1,1,w-1,1);
-    }
-    else if (((m_button_style & wxCUSTBUT_FLAT) == 0) || m_focused) // draw raised border
-    {
-        dc.SetPen(*wxWHITE_PEN);
-        dc.DrawLine(0,h-2,0,0);     dc.DrawLine(0,0,w-1,0);
-        dc.SetPen(*wxBLACK_PEN);
-        dc.DrawLine(w-1,0,w-1,h-1); dc.DrawLine(w-1,h-1,-1,h-1);
-        dc.SetPen(*wxGREY_PEN);
-        dc.DrawLine(2,h-2,w-2,h-2); dc.DrawLine(w-2,h-2,w-2,1);
-    }
-
-    dc.SetBackground(wxNullBrush);
-    dc.SetBrush(wxNullBrush);
-    dc.SetPen(wxNullPen);
-#if (wxMINOR_VERSION<8) 
-    dc.EndDrawing();
-#endif
-}
-
-void wxCustomButton::OnSize( wxSizeEvent &event )
-{
-    CalcLayout(TRUE);
-    event.Skip();
-}
-
-void wxCustomButton::SetMargins(const wxSize &margin, bool fit)
-{ 
-    m_labelMargin = margin; 
-    m_bitmapMargin = margin; 
-    CalcLayout(TRUE); 
-    if (fit) SetSize(DoGetBestSize());
-}
-void wxCustomButton::SetLabelMargin(const wxSize &margin, bool fit) 
-{ 
-    m_labelMargin = margin; 
-    CalcLayout(TRUE); 
-    if (fit) SetSize(DoGetBestSize());
-}
-void wxCustomButton::SetBitmapMargin(const wxSize &margin, bool fit) 
-{ 
-    m_bitmapMargin = margin; 
-    CalcLayout(TRUE); 
-    if (fit) SetSize(DoGetBestSize());
-}
-
-wxSize wxCustomButton::DoGetBestSize() const
-{
-    int lw=0, lh=0;
-    int bw=0, bh=0;
-    bool has_bitmap = FALSE;
-    bool has_label = FALSE;
-    
-    if (!GetLabel().IsEmpty())
-    {
-        GetTextExtent(GetLabel(), &lw, &lh);
-        lw += 2*m_labelMargin.x;
-        lh += 2*m_labelMargin.y;
-        has_label = TRUE;
-    }
-    if (m_bmpLabel.Ok())
-    {
-        bw = m_bmpLabel.GetWidth() + 2*m_bitmapMargin.x;
-        bh = m_bmpLabel.GetHeight() + 2*m_bitmapMargin.y;
-        has_bitmap = TRUE;
-    }
-
-    if ((m_button_style & wxCUSTBUT_LEFT) || (m_button_style & wxCUSTBUT_RIGHT))
-    {
-        int h = bh > lh ? bh : lh;
-        if (has_bitmap && has_label) lw -= wxMin(m_labelMargin.x, m_bitmapMargin.x);
-        return wxSize(lw+bw, h);
-    }
-
-    int w = bw > lw ? bw : lw;
-    if (has_bitmap && has_label) lh -= wxMin(m_labelMargin.y, m_bitmapMargin.y);
-    return wxSize(w, lh+bh);
-}
-
-void wxCustomButton::CalcLayout(bool refresh)
-{
-    int w, h;
-    GetSize(&w,&h);
-
-    int bw = 0, bh = 0;
-    int lw = 0, lh = 0;
-
-    if (m_bmpLabel.Ok()) // assume they're all the same size
-    {
-        bw = m_bmpLabel.GetWidth();
-        bh = m_bmpLabel.GetHeight();
-    }
-    wxString label = GetLabel();
-    if (!label.IsEmpty())
-    {
-        GetTextExtent(label, &lw, &lh);
-    }
-    
-    // Center the label or bitmap if only one or the other
-    if (!m_bmpLabel.Ok())
-    {
-        m_bitmapPos = wxPoint(0,0);
-        m_labelPos = wxPoint((w-lw)/2, (h-lh)/2);
-    }
-    else if (label.IsEmpty())
-    {
-        m_bitmapPos = wxPoint((w-bw)/2, (h-bh)/2);
-        m_labelPos = wxPoint(0,0);
-    }
-    else if (m_button_style & wxCUSTBUT_LEFT)
-    {
-        int mid_margin = wxMax(m_labelMargin.x, m_bitmapMargin.x);
-        m_labelPos  = wxPoint((w - (bw+lw+m_labelMargin.x+m_bitmapMargin.x+mid_margin))/2 + m_labelMargin.x, (h - lh)/2);
-        m_bitmapPos = wxPoint(m_labelPos.x + lw + mid_margin,         (h - bh)/2);
-    }
-    else if (m_button_style & wxCUSTBUT_RIGHT)
-    {
-        int mid_margin = wxMax(m_labelMargin.x, m_bitmapMargin.x);
-        m_bitmapPos = wxPoint((w - (bw+lw+m_labelMargin.x+m_bitmapMargin.x+mid_margin))/2 + m_bitmapMargin.x, (h - bh)/2);
-        m_labelPos  = wxPoint(m_bitmapPos.x + bw + mid_margin,        (h - lh)/2);
-    }
-    else if (m_button_style & wxCUSTBUT_TOP)
-    {
-        int mid_margin = wxMax(m_labelMargin.y, m_bitmapMargin.y);
-        m_labelPos  = wxPoint((w - lw)/2, (h - (bh+lh+m_labelMargin.y+m_bitmapMargin.y+mid_margin))/2 + m_labelMargin.y);
-        m_bitmapPos = wxPoint((w - bw)/2, m_labelPos.y + lh + mid_margin);
-    }
-    else // if (m_button_style & wxCUSTBUT_BOTTOM)  DEFAULT
-    {
-        int mid_margin = wxMax(m_labelMargin.y, m_bitmapMargin.y);
-        m_bitmapPos = wxPoint((w - bw)/2, (h - (bh+lh+m_labelMargin.y+m_bitmapMargin.y+mid_margin))/2 + m_bitmapMargin.y);
-        m_labelPos  = wxPoint((w - lw)/2, m_bitmapPos.y + bh + mid_margin);
-    }
-    
-    if (refresh) Refresh(FALSE);
-}
-
-
-/* XPM */
-static const char *down_arrow_xpm_data[] = {
-/* columns rows colors chars-per-pixel */
-"5 3 2 1",
-"  c None",
-"a c Black",
-/* pixels */
-"aaaaa",
-" aaa ",
-"  a  "};
-
-static wxBitmap s_dropdownBitmap; // all buttons share the same bitmap
-
-enum
-{
-    IDD_DROPDOWN_BUTTON = 100
-};
-
-//-----------------------------------------------------------------------------
-// wxMenuButtonEvents
-//-----------------------------------------------------------------------------
-
-DEFINE_LOCAL_EVENT_TYPE(wxEVT_MENUBUTTON_OPEN)
-
-// ==========================================================================
-// MenuDropButton
-// ==========================================================================
-
-class MenuDropButton : public wxCustomButton
-{
-public:
-    MenuDropButton( wxWindow *parent, wxWindowID id, long style) : wxCustomButton()
-    {
-        if (!s_dropdownBitmap.Ok())
-            s_dropdownBitmap = wxBitmap(down_arrow_xpm_data);
-        
-        Create( parent, id, wxEmptyString, s_dropdownBitmap, wxDefaultPosition, 
-                wxSize(wxMENUBUTTON_DROP_WIDTH, wxMENUBUTTON_DROP_HEIGHT), style);    
-    }
-    
-    virtual void Paint( wxDC &dc )
-    {
-        wxCustomButton *labelBut = ((wxMenuButton*)GetParent())->GetLabelButton();
-        
-        // pretend that both buttons have focus (for flat style)
-        if (labelBut)
-        {
-            wxPoint p = GetParent()->ScreenToClient(wxGetMousePosition());
-        
-#if (wxMINOR_VERSION<8) 
-            if (GetRect().Inside(p) || labelBut->GetRect().Inside(p))
-#else
-            if (GetRect().Contains(p) || labelBut->GetRect().Contains(p))
-#endif
-            {
-                m_focused = TRUE;
-                
-                if (!labelBut->GetFocused())
-                    labelBut->SetFocused(TRUE);
-            }
-            else
-            {
-                m_focused = FALSE;
-                
-                if (labelBut->GetFocused())
-                    labelBut->SetFocused(FALSE);
-            }
-        }
-        
-        wxCustomButton::Paint(dc);
-    }
-};
-
-// ==========================================================================
-// MenuLabelButton
-// ==========================================================================
-
-class MenuLabelButton : public wxCustomButton
-{
-public:
-    MenuLabelButton( wxWindow* parent, wxWindowID id, 
-                     const wxString &label, 
-                     const wxBitmap &bitmap,
-                     long style ) : wxCustomButton()
-    {
-        Create(parent, id, label, bitmap, wxDefaultPosition, wxDefaultSize, style);    
-    }
-    
-    virtual void Paint( wxDC &dc )
-    {
-        wxCustomButton *dropBut = ((wxMenuButton*)GetParent())->GetDropDownButton();
-
-        // pretend that both buttons have focus (for flat style)
-        if (dropBut) 
-        {
-            wxPoint p = GetParent()->ScreenToClient(wxGetMousePosition());
-        
-#if (wxMINOR_VERSION<8) 
-            if (GetRect().Inside(p) || dropBut->GetRect().Inside(p))
-#else
-            if (GetRect().Contains(p) || dropBut->GetRect().Contains(p))
-#endif
-            {
-                m_focused = TRUE;
-                
-                if (!dropBut->GetFocused())
-                    dropBut->SetFocused(TRUE);
-            }
-            else
-            {
-                m_focused = FALSE;
-                
-                if (dropBut->GetFocused())
-                    dropBut->SetFocused(FALSE);
-            }
-        }
-
-        wxCustomButton::Paint(dc);
-    }
-};
-
-// ==========================================================================
-// wxMenuButton
-// ==========================================================================
-
-IMPLEMENT_DYNAMIC_CLASS( wxMenuButton, wxControl )
-
-BEGIN_EVENT_TABLE(wxMenuButton,wxControl)
-    EVT_BUTTON(wxID_ANY, wxMenuButton::OnButton)
-
-#ifdef __WXMSW__
-    EVT_MENU(wxID_ANY, wxMenuButton::OnMenu)
-#endif
-END_EVENT_TABLE()
-
-wxMenuButton::~wxMenuButton()
-{
-    AssignMenu(NULL, TRUE);
-}
-
-void wxMenuButton::Init()
-{
-    m_labelButton = NULL;
-    m_dropdownButton = NULL;
-    m_menu = NULL;
-    m_menu_static = FALSE;
-    m_style = 0;
-}
-
-bool wxMenuButton::Create( wxWindow* parent, wxWindowID id,
-                           const wxString &label, 
-                           const wxBitmap &bitmap,
-                           const wxPoint& pos, 
-                           const wxSize& size,
-                           long style, 
-                           const wxValidator& val,
-                           const wxString& name)
-{
-    m_style = style;
-    
-    long flat = style & wxMENUBUT_FLAT;
-    
-    wxControl::Create(parent,id,pos,size,wxNO_BORDER|wxCLIP_CHILDREN,val,name);
-    wxControl::SetLabel(label);
-    SetBackgroundColour(parent->GetBackgroundColour());
-    SetForegroundColour(parent->GetForegroundColour());
-    SetFont(parent->GetFont());
-
-    m_labelButton = new MenuLabelButton(this, id, label, bitmap, wxCUSTBUT_BUTTON|flat);
-    m_dropdownButton = new MenuDropButton(this, IDD_DROPDOWN_BUTTON, wxCUSTBUT_BUTTON|flat);
-    
-    wxSize bestSize = DoGetBestSize();
-    SetSize( wxSize(size.x < 0 ? bestSize.x : size.x, 
-                    size.y < 0 ? bestSize.y : size.y) );
-   
-#if (wxMINOR_VERSION<8) 
-    SetBestSize(GetSize());
-#else
-    SetInitialSize(GetSize());
-#endif
-    
-    return TRUE;
-}
-
-#ifdef __WXMSW__
-// FIXME - I think there was a patch to fix this
-void wxMenuButton::OnMenu( wxCommandEvent &event ) 
-{
-    event.Skip();    
-    wxMenuItem *mi = m_menu->FindItem(event.GetId());
-    if (mi && (mi->GetKind() == wxITEM_RADIO))
-        m_menu->Check(event.GetId(), TRUE);    
-}
-#endif // __WXMSW__
-
-void wxMenuButton::OnButton( wxCommandEvent &event)
-{
-    int win_id = event.GetId();
-    
-    if (win_id == IDD_DROPDOWN_BUTTON)
-    {
-        wxNotifyEvent mevent(wxEVT_MENUBUTTON_OPEN, GetId());
-        mevent.SetEventObject(this);
-        if (GetEventHandler()->ProcessEvent(mevent) && !mevent.IsAllowed())
-            return;
-
-        if (!m_menu) 
-            return;
-        
-        PopupMenu(m_menu, wxPoint(0, GetSize().y));
-        
-        m_labelButton->Refresh(FALSE);
-        m_dropdownButton->Refresh(FALSE);
-    }
-    else if (win_id == m_labelButton->GetId())
-    {
-
-        wxCommandEvent cevent(wxEVT_COMMAND_MENU_SELECTED, win_id);
-        cevent.SetEventObject(this);
-        cevent.SetId(win_id);
-               GetParent()->GetEventHandler()->ProcessEvent(cevent);
-
-        if (!m_menu) return;
-        
-        const wxMenuItemList &items = m_menu->GetMenuItems();
-        int first_radio_id = -1;
-        int checked_id = -1;
-        bool check_next = FALSE;
-        
-        // find the next available radio item to check
-        for (wxMenuItemList::Node *node = items.GetFirst(); node; node = node->GetNext())
-        {
-            wxMenuItem *mi = (wxMenuItem*)node->GetData();
-            if (mi && (mi->GetKind() == wxITEM_RADIO))
-            {
-                if (first_radio_id == -1) 
-                    first_radio_id = mi->GetId();
-                
-                if (check_next) 
-                {
-                    check_next = FALSE;
-                    checked_id = mi->GetId();
-                    break;
-                }
-                else if (mi->IsChecked()) 
-                    check_next = TRUE;
-            }
-        }
-        // the last item was checked, go back to the first
-        if (check_next && (first_radio_id != -1))
-            checked_id = first_radio_id;
-        
-        if (checked_id != -1)
-        {
-            m_menu->Check(checked_id, TRUE);
-            
-            wxCommandEvent mevent( wxEVT_COMMAND_MENU_SELECTED, checked_id);
-            mevent.SetEventObject( m_menu );
-            mevent.SetInt(1);
-            GetEventHandler()->ProcessEvent(mevent);
-        }
-    }
-}
-
-int wxMenuButton::GetSelection() const
-{
-    wxCHECK_MSG(m_menu != NULL, wxNOT_FOUND, wxT("No attached menu in wxMenuButton::GetSelection"));
-        
-    const wxMenuItemList &items = m_menu->GetMenuItems();
-        
-    for (wxMenuItemList::Node *node = items.GetFirst(); node; node = node->GetNext())
-    {
-        wxMenuItem *mi = (wxMenuItem*)node->GetData();
-        if (mi && (mi->GetKind() == wxITEM_RADIO))
-        {
-            if (mi->IsChecked())
-                return mi->GetId();
-        }
-    }
-    
-    return wxNOT_FOUND;    
-}
-
-void wxMenuButton::AssignMenu(wxMenu *menu, bool static_menu)
-{
-    if (!m_menu_static && m_menu) 
-        delete m_menu;
-    
-    m_menu = menu;
-    m_menu_static = static_menu;
-}
-
-void wxMenuButton::SetToolTip(const wxString &tip) 
-{ 
-    wxWindow::SetToolTip(tip);
-    ((wxWindow*)m_labelButton)->SetToolTip(tip); 
-    ((wxWindow*)m_dropdownButton)->SetToolTip(tip);
-}
-void wxMenuButton::SetToolTip(wxToolTip *tip) 
-{ 
-    wxWindow::SetToolTip(tip);
-    ((wxWindow*)m_labelButton)->SetToolTip(tip); 
-    ((wxWindow*)m_dropdownButton)->SetToolTip(tip);
-}
-
-void wxMenuButton::DoSetSize(int x, int y, int width, int height, int sizeFlags)
-{
-    wxSize curSize( GetSize() );
-    wxSize bestSize( DoGetBestSize() );
-
-    if (width == -1)
-        width = curSize.GetWidth();
-    if (width < 10) 
-        width = bestSize.GetWidth();
-
-    if (height == -1)
-        height = curSize.GetHeight();
-    if (height < 5) 
-        height = bestSize.GetHeight();
-    
-    wxWindow::DoSetSize(x, y, width, height, sizeFlags);    
-
-    if (m_labelButton)
-        m_labelButton->SetSize(0, 0, width - wxMENUBUTTON_DROP_WIDTH, height);
-    if (m_dropdownButton)
-        m_dropdownButton->SetSize(width-wxMENUBUTTON_DROP_WIDTH, 0, wxMENUBUTTON_DROP_WIDTH, height);    
-}
-
-wxSize wxMenuButton::DoGetBestSize()
-{
-    if (!m_labelButton || !m_dropdownButton) 
-        return wxSize(wxMENUBUTTON_DROP_WIDTH+wxMENUBUTTON_DROP_HEIGHT, wxMENUBUTTON_DROP_HEIGHT);
-
-    wxSize size = m_labelButton->GetBestSize();
-    size.x += wxMENUBUTTON_DROP_WIDTH;
-    return size;
-}
diff --git a/applications/osmo4_wx/menubtn.h b/applications/osmo4_wx/menubtn.h
deleted file mode 100644 (file)
index 441c7b7..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name:        wxMenuButton
-// Purpose:     A button with a dropdown wxMenu
-// Author:      John Labenski
-// Modified by:
-// Created:     11/05/2002
-// Copyright:   (c) John Labenski
-// Licence:     wxWidgets licence
-/////////////////////////////////////////////////////////////////////////////
-
-/*
-
-wxMenuButton is a button that drops down an assigned wxMenu
-
-Create the button with either a text or bitmap label.
-    Create a new wxMenu and call AssignMenu and thats it. When you press the 
-    dropdown button the menu appears. When you press the label button the next
-    wxITEM_RADIO (ie wxMenuItem::GetKind) in the menu is selected round robin.
-    If there are no radio items then it really just acts like a menubar, though
-    this is probably not too useful. The events sent in this case are EVT_MENUs
-    either generated by the menu when you click on it or created when you click
-    on the label to select the next radio item.
-*/
-
-#ifndef _WX_MENUBTN_H_
-#define _WX_MENUBTN_H_
-
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma interface "menubtn.h"
-#endif
-
-class wxMenu;
-class wxBitmap;
-class wxCustomButton;
-
-//-----------------------------------------------------------------------------
-// wxCustomButton styles
-//-----------------------------------------------------------------------------
-
-enum wxCustomButton_Style
-{
-    // Position of the label, use only one
-    wxCUSTBUT_LEFT           = 0x0001,
-    wxCUSTBUT_RIGHT          = 0x0002,
-    wxCUSTBUT_TOP            = 0x0004,
-    wxCUSTBUT_BOTTOM         = 0x0008,
-    // Button style, use only one
-    wxCUSTBUT_NOTOGGLE       = 0x0100,
-    wxCUSTBUT_BUTTON         = 0x0200,
-    wxCUSTBUT_TOGGLE         = 0x0400,
-    wxCUSTBUT_BUT_DCLICK_TOG = 0x0800,
-    wxCUSTBUT_TOG_DCLICK_BUT = 0x1000, 
-    // drawing styles
-    wxCUSTBUT_FLAT           = 0x2000 // flat, mouseover raises if not depressed
-};
-
-//-----------------------------------------------------------------------------
-// wxCustomButton
-//-----------------------------------------------------------------------------
-
-class WXDLLEXPORT wxCustomButton : public wxControl
-{
-public:
-
-    wxCustomButton() : wxControl() { Init(); }
-    
-    // wxToggleButton or wxButton compatible constructor (also wxTextCtrl)
-    wxCustomButton(wxWindow* parent, wxWindowID id,
-                   const wxString& label,
-                   const wxPoint& pos = wxDefaultPosition,
-                   const wxSize& size = wxDefaultSize,
-                   long style = wxCUSTBUT_TOGGLE,
-                   const wxValidator& val = wxDefaultValidator,
-                   const wxString& name = wxT("wxCustomButton"))
-                   : wxControl()
-    {
-        Init();
-        Create(parent,id,label,wxNullBitmap,pos,size,style,val,name);
-    }
-
-    // wxBitmapButton compatible constructor
-    wxCustomButton(wxWindow *parent, wxWindowID id,
-                   const wxBitmap& bitmap,
-                   const wxPoint& pos = wxDefaultPosition,
-                   const wxSize& size = wxDefaultSize,
-                   long style = wxCUSTBUT_TOGGLE,
-                   const wxValidator& val = wxDefaultValidator,
-                   const wxString& name = wxT("wxCustomButton"))
-                   : wxControl()
-    {
-        Init();
-        Create(parent,id,wxEmptyString,bitmap,pos,size,style,val,name);
-    }
-
-    // Native constructor
-    wxCustomButton(wxWindow *parent, wxWindowID id,
-                   const wxString& label, const wxBitmap& bitmap,
-                   const wxPoint& pos = wxDefaultPosition,
-                   const wxSize& size = wxDefaultSize,
-                   long style = wxCUSTBUT_TOGGLE|wxCUSTBUT_BOTTOM,
-                   const wxValidator& val = wxDefaultValidator,
-                   const wxString& name = wxT("wxCustomButton"))
-                   : wxControl()
-    {
-        Init();
-        Create(parent,id,label,bitmap,pos,size,style,val,name);
-    }
-
-    virtual ~wxCustomButton();
-        
-    bool Create(wxWindow* parent,
-                wxWindowID id,
-                const wxString& label,
-                const wxBitmap &bitmap,
-                const wxPoint& pos = wxDefaultPosition,
-                const wxSize& size = wxDefaultSize,
-                long style = 0,
-                const wxValidator& val = wxDefaultValidator,
-                const wxString& name = wxT("wxCustomButton"));
-
-    bool GetValue() const { return m_down%2 != 0; }
-    void SetValue( bool depressed );
-
-    // Use combinations of wxCustomButton_Style(s)
-    long GetButtonStyle() const { return m_button_style; }
-    bool SetButtonStyle( long style );
-    
-    // Set the text label, wxEmptyString for none
-    void SetLabel( const wxString &label );
-
-    // set the bitmaps, ONLY this Label bitmap is used for calculating control size
-    //   all bitmaps will be centered accordingly in any case
-    //   call SetSet(GetBestSize()) if you change their size and want the control to resize appropriately
-    void SetBitmapLabel(const wxBitmap& bitmap);
-    void SetBitmapSelected(const wxBitmap& sel)      { m_bmpSelected = sel; CalcLayout(TRUE); };
-    void SetBitmapFocus(const wxBitmap& focus)       { m_bmpFocus = focus; CalcLayout(TRUE); };
-    void SetBitmapDisabled(const wxBitmap& disabled) { m_bmpDisabled = disabled; CalcLayout(TRUE); };
-    // wxBitmapButton compatibility
-    void SetLabel(const wxBitmap& bitmap)            { SetBitmapLabel(bitmap); }
-
-    // retrieve the bitmaps
-    const wxBitmap& GetBitmapLabel()    const { return m_bmpLabel;    }
-    const wxBitmap& GetBitmapSelected() const { return m_bmpSelected; }
-    const wxBitmap& GetBitmapFocus()    const { return m_bmpFocus;    }
-    const wxBitmap& GetBitmapDisabled() const { return m_bmpDisabled; }
-
-    // Creates a "disabled" bitmap by dithering it with the background colour
-    wxBitmap CreateBitmapDisabled(const wxBitmap &bitmap) const;
-    
-    // set/get the margins (in pixels) around the label and bitmap
-    //    if fit = TRUE then resize the button to fit
-    void SetMargins(const wxSize &margin, bool fit = FALSE); 
-    
-    // set/get the margins around the text label
-    //    the inter bitmap/label margin is the max of either margin, not the sum
-    void SetLabelMargin(const wxSize &margin, bool fit = FALSE);
-    wxSize GetLabelMargin() const { return m_labelMargin; }
-    // set/get the margins around the bitmap
-    //    the inter bitmap/label margin is the max of either margin, not the sum
-    void SetBitmapMargin(const wxSize &margin, bool fit = FALSE);
-    wxSize GetBitmapMargin() const { return m_bitmapMargin; }
-    
-    // can be used to activate the focused behavior (see MenuButton)
-    void SetFocused(bool focused) { m_focused = focused; Refresh(FALSE); }
-    bool GetFocused() const { return m_focused; }
-    
-protected:
-    void OnPaint(wxPaintEvent &event);
-    void Redraw();
-    virtual void Paint( wxDC &dc );
-
-    virtual wxSize DoGetBestSize() const;
-
-    virtual void SendEvent();
-    
-    void OnMouseEvents(wxMouseEvent &event);
-
-    void OnSize( wxSizeEvent &event );
-
-    virtual void CalcLayout(bool refresh);
-
-    long m_down;         // toggle state if m_down%2 then depressed
-    bool m_focused;     // mouse in window
-    long m_button_style;
-
-    // the bitmaps for various states
-    wxBitmap m_bmpLabel,
-             m_bmpSelected,
-             m_bmpFocus,
-             m_bmpDisabled;
-
-    // the margins around the label/bitmap
-    wxSize m_labelMargin,
-           m_bitmapMargin;
-
-    wxPoint m_bitmapPos,
-            m_labelPos;
-
-    wxTimer *m_timer;
-    
-    wxEventType m_eventType;     // store the mouse event type
-
-private:
-    void Init();
-    DECLARE_DYNAMIC_CLASS(wxCustomButton)
-    DECLARE_EVENT_TABLE()
-};
-
-//-----------------------------------------------------------------------------
-// wxMenuButton styles
-//-----------------------------------------------------------------------------
-
-#define wxMENUBUTTON_DROP_WIDTH  10
-#define wxMENUBUTTON_DROP_HEIGHT 22
-
-enum wxMenuButton_Styles
-{
-    wxMENUBUT_FLAT = wxCUSTBUT_FLAT
-};
-
-//-----------------------------------------------------------------------------
-// wxMenuButton
-//-----------------------------------------------------------------------------
-
-class wxMenuButton : public wxControl
-{
-public:
-
-    wxMenuButton() : wxControl() { Init(); }
-
-    // Use this constructor if you need one compatible with a wxBitmapButton
-    //   setup the button later with AssignMenu
-    wxMenuButton( wxWindow* parent, wxWindowID id,
-                  const wxBitmap &bitmap, 
-                  const wxPoint& pos = wxDefaultPosition,
-                  const wxSize& size = wxDefaultSize,
-                  long style = 0, 
-                                 const wxValidator& val = wxDefaultValidator,
-                  const wxString& name = wxT("wxMenuButton"))
-                  : wxControl()
-    {
-        Init();
-        Create(parent,id,wxEmptyString,bitmap,pos,size,style,val,name);
-    }
-
-    virtual ~wxMenuButton();
-        
-    bool Create( wxWindow* parent,
-                 wxWindowID id,
-                 const wxString &label,
-                 const wxBitmap &bitmap,
-                 const wxPoint& pos = wxDefaultPosition,
-                 const wxSize& size = wxDefaultSize,
-                 long style = wxNO_BORDER,
-                 const wxValidator& val = wxDefaultValidator,
-                 const wxString& name = wxT("wxMenuButton"));
-
-    // Gets the id of the first selected radio item or wxNOT_FOUND (-1) if none
-    int GetSelection() const;
-    
-    // This menu will be displayed when the dropdown button is pressed.
-    //   if static_menu is FALSE it will be deleted when the buttton is destroyed.
-    void AssignMenu(wxMenu *menu, bool static_menu = FALSE); 
-    
-    wxMenu *GetMenu() const { return m_menu; }
-    
-    // get a pointer to the label button, for turning it into a toggle perhaps
-    wxCustomButton *GetLabelButton() const { return m_labelButton; }
-    wxCustomButton *GetDropDownButton() const { return m_dropdownButton; }
-    
-    void SetToolTip(const wxString &tip);
-    void SetToolTip(wxToolTip *tip);
-    
-protected:
-    void OnButton(wxCommandEvent &event);    
-
-    virtual void DoSetSize(int x, int y, int width, int height,
-                           int sizeFlags = wxSIZE_AUTO);
-
-    virtual wxSize DoGetBestSize();
-
-// FIXME! - in MSW the radio items don't check themselves
-#ifdef __WXMSW__
-    void OnMenu( wxCommandEvent &event );
-#endif
-
-    wxCustomButton *m_labelButton;
-    wxCustomButton *m_dropdownButton;
-
-    wxMenu *m_menu;
-    bool m_menu_static;
-    long m_style;
-
-private:
-    void Init();
-    DECLARE_DYNAMIC_CLASS(wxMenuButton)
-    DECLARE_EVENT_TABLE()
-};
-
-//-----------------------------------------------------------------------------
-// wxMenuButtonEvents
-// 
-// EVT_MENUBUTTON_OPEN(id, fn) - menu is about to be opened, (dis)(en)able items
-//                               or call Veto() to stop menu from popping up
-//                               this is a wxNotifyEvent
-//-----------------------------------------------------------------------------
-
-BEGIN_DECLARE_EVENT_TYPES()
-    DECLARE_LOCAL_EVENT_TYPE( wxEVT_MENUBUTTON_OPEN, 0 )
-END_DECLARE_EVENT_TYPES()
-
-#define EVT_MENUBUTTON_OPEN(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_MENUBUTTON_OPEN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNotifyEventFunction) & fn, (wxObject *) NULL ),
-
-#endif  // _WX_MENUBTN_H_
diff --git a/applications/osmo4_wx/osmo4.ico b/applications/osmo4_wx/osmo4.ico
deleted file mode 100644 (file)
index 36ff667..0000000
Binary files a/applications/osmo4_wx/osmo4.ico and /dev/null differ
diff --git a/applications/osmo4_wx/osmo4.xpm b/applications/osmo4_wx/osmo4.xpm
deleted file mode 100644 (file)
index bec8e6a..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-/* XPM */
-static const char * osmo4[] = {
-"32 32 266 2",
-"      c None",
-".     c #990909",
-"+     c #A10505",
-"@     c #AB0404",
-"#     c #AF0202",
-"$     c #B10303",
-"%     c #AE0202",
-"&     c #A90505",
-"*     c #A10606",
-"=     c #990E0E",
-"-     c #990D0D",
-";     c #A80303",
-">     c #BD0000",
-",     c #D40000",
-"'     c #DE0000",
-")     c #E20000",
-"!     c #E10000",
-"~     c #DC0000",
-"{     c #CD0000",
-"]     c #B80101",
-"^     c #A40909",
-"/     c #A20505",
-"(     c #BD0101",
-"_     c #E00000",
-":     c #CB0000",
-"<     c #A80000",
-"[     c #7E0101",
-"}     c #6B0202",
-"|     c #670202",
-"1     c #720202",
-"2     c #920000",
-"3     c #B70000",
-"4     c #D70000",
-"5     c #B80303",
-"6     c #9D0B0B",
-"7     c #980909",
-"8     c #B00202",
-"9     c #DB0000",
-"0     c #B50909",
-"a     c #8A1313",
-"b     c #1C0505",
-"c     c #070505",
-"d     c #080808",
-"e     c #0A0A0A",
-"f     c #090909",
-"g     c #070707",
-"h     c #0C0404",
-"i     c #5B1414",
-"j     c #A70F0F",
-"k     c #CC0303",
-"l     c #CC0000",
-"m     c #AB0505",
-"n     c #950D0D",
-"o     c #B60101",
-"p     c #DD0000",
-"q     c #CF0202",
-"r     c #9C1414",
-"s     c #141414",
-"t     c #0C0C0C",
-"u     c #0F0F0F",
-"v     c #111111",
-"w     c #101010",
-"x     c #0E0E0E",
-"y     c #B70707",
-"z     c #DF0000",
-"A     c #D50000",
-"B     c #A90606",
-"C     c #970E0E",
-"D     c #B30202",
-"E     c #C50505",
-"F     c #812121",
-"G     c #191919",
-"H     c #161616",
-"I     c #181818",
-"J     c #171717",
-"K     c #151515",
-"L     c #AF0A0A",
-"M     c #D70101",
-"N     c #D60000",
-"O     c #AD0606",
-"P     c #AA0303",
-"Q     c #DA0000",
-"R     c #C80505",
-"S     c #8E1E1E",
-"T     c #1D1D1D",
-"U     c #1F1F1F",
-"V     c #202020",
-"W     c #B00909",
-"X     c #CE0000",
-"Y     c #9F0A0A",
-"Z     c #9B0808",
-"`     c #D20000",
-" .    c #D80101",
-"..    c #8B1B1B",
-"+.    c #2D2D2D",
-"@.    c #272727",
-"#.    c #262626",
-"$.    c #252525",
-"%.    c #BB0606",
-"&.    c #BB0303",
-"*.    c #AF0303",
-"=.    c #AF0B0B",
-"-.    c #303030",
-";.    c #2B2B2B",
-">.    c #323232",
-",.    c #CD0202",
-"'.    c #A60A0A",
-").    c #9E0909",
-"!.    c #CF0000",
-"~.    c #CE0404",
-"{.    c #292929",
-"].    c #B10808",
-"^.    c #A70303",
-"/.    c #B60A0A",
-"(.    c #961010",
-"_.    c #B90000",
-":.    c #9C1212",
-"<.    c #1A1A1A",
-"[.    c #222222",
-"}.    c #1C1C1C",
-"|.    c #C20202",
-"1.    c #A30606",
-"2.    c #C60000",
-"3.    c #2A2A2A",
-"4.    c #3B3B3B",
-"5.    c #444444",
-"6.    c #434343",
-"7.    c #3A3A3A",
-"8.    c #1E1E1E",
-"9.    c #131313",
-"0.    c #BB0A0A",
-"a.    c #AD0707",
-"b.    c #9A1515",
-"c.    c #D30000",
-"d.    c #353535",
-"e.    c #484848",
-"f.    c #5F5F5F",
-"g.    c #6C6C6C",
-"h.    c #646464",
-"i.    c #565656",
-"j.    c #343434",
-"k.    c #212121",
-"l.    c #121212",
-"m.    c #B30505",
-"n.    c #B10404",
-"o.    c #9A1111",
-"p.    c #424242",
-"q.    c #555555",
-"r.    c #6B6B6B",
-"s.    c #757575",
-"t.    c #6E6E6E",
-"u.    c #606060",
-"v.    c #4E4E4E",
-"w.    c #3F3F3F",
-"x.    c #2C2C2C",
-"y.    c #B10909",
-"z.    c #B60707",
-"A.    c #9B1515",
-"B.    c #D00000",
-"C.    c #494949",
-"D.    c #595959",
-"E.    c #676767",
-"F.    c #696969",
-"G.    c #616161",
-"H.    c #525252",
-"I.    c #454545",
-"J.    c #B20707",
-"K.    c #363636",
-"L.    c #626262",
-"M.    c #5B5B5B",
-"N.    c #505050",
-"O.    c #282828",
-"P.    c #B80B0B",
-"Q.    c #AC0707",
-"R.    c #AA1111",
-"S.    c #0D0D0D",
-"T.    c #585858",
-"U.    c #545454",
-"V.    c #4B4B4B",
-"W.    c #BF0303",
-"X.    c #9F0B0B",
-"Y.    c #B90707",
-"Z.    c #242424",
-"`.    c #313131",
-" +    c #3E3E3E",
-".+    c #474747",
-"++    c #4D4D4D",
-"@+    c #4F4F4F",
-"#+    c #4C4C4C",
-"$+    c #3D3D3D",
-"%+    c #D90000",
-"&+    c #8E1010",
-"*+    c #A00808",
-"=+    c #D00303",
-"-+    c #3C3C3C",
-";+    c #0B0B0B",
-">+    c #AE0808",
-",+    c #C10101",
-"'+    c #BB0202",
-")+    c #BA0A0A",
-"!+    c #1B1B1B",
-"~+    c #2F2F2F",
-"{+    c #C10303",
-"]+    c #A10A0A",
-"^+    c #9F0707",
-"/+    c #D80000",
-"(+    c #BE0303",
-"_+    c #821C1C",
-":+    c #C20404",
-"<+    c #232323",
-"[+    c #A90C0C",
-"}+    c #970C0C",
-"|+    c #960E0E",
-"1+    c #BE0101",
-"2+    c #C60505",
-"3+    c #131212",
-"4+    c #B00B0B",
-"5+    c #CE0101",
-"6+    c #A80707",
-"7+    c #990B0B",
-"8+    c #C40404",
-"9+    c #AD0909",
-"0+    c #D00101",
-"a+    c #B00505",
-"b+    c #7B1C1C",
-"c+    c #960C0C",
-"d+    c #BC0202",
-"e+    c #BC0808",
-"f+    c #962525",
-"g+    c #482E2E",
-"h+    c #1E1616",
-"i+    c #141010",
-"j+    c #2F2020",
-"k+    c #703636",
-"l+    c #A81212",
-"m+    c #A90707",
-"n+    c #8E1313",
-"o+    c #D30606",
-"p+    c #B91E1E",
-"q+    c #901919",
-"r+    c #661010",
-"s+    c #540F0F",
-"t+    c #4F0D0D",
-"u+    c #5A0F0F",
-"v+    c #7A1515",
-"w+    c #A21E1E",
-"x+    c #C51212",
-"y+    c #D60101",
-"z+    c #980D0D",
-"A+    c #930C0C",
-"B+    c #B30404",
-"C+    c #C60202",
-"D+    c #7B1919",
-"E+    c #8C1515",
-"F+    c #9F0909",
-"G+    c #B20303",
-"H+    c #C30000",
-"I+    c #CA0000",
-"J+    c #C90000",
-"K+    c #BC0101",
-"L+    c #AA0505",
-"M+    c #8F1111",
-"N+    c #7F1E1E",
-"O+    c #732626",
-"P+    c #762A2A",
-"Q+    c #6E2828",
-"                                                                ",
-"                        . + @ # $ % & * =                       ",
-"                  - ; > , ' ) ) ! ) ! ~ { ] ^                   ",
-"                / ( ' _ : < [ } | 1 2 3 4 ) , 5 6               ",
-"            7 8 9 ' 0 a b c d e e f g h i j k ) l m             ",
-"          n o p q r     s t u v v w t x       y z A B           ",
-"        C D ) E F         G H I G J K           L M N O         ",
-"        P Q R S             T U U T V             W ' X Y       ",
-"      Z `  ...              +.@.#.$.                %.! &.      ",
-"      *.) =.                  -.;.>.                  ,.4 '.    ",
-"    ).!.~.                      {.                    ].) (     ",
-"    ^.z /.                      $.                      A ` (.  ",
-"    _.! :.              K K <.V [.}.K K                 |.z 1.  ",
-"    2.9               v <.3.4.5.6.7.;.8.9.J             0.) a.  ",
-"  b.!.c.            w }.d.e.f.g.h.i.5.j.k.l.            m._ n.  ",
-"  o.` !.          u J 3.p.q.r.s.t.u.v.w.x.T w           y._ z.  ",
-"  A.B.`           u k.j.C.D.E.g.F.G.H.I.j.$.9.l.        m._ J.  ",
-"    : 4         s v #.K.C.q.u.h.L.M.N.I.K.O.J x         P.) Q.  ",
-"    > z R.      S.9.#.d.5.v.i.D.T.U.V.p.j.{.G t         W._ X.  ",
-"    % ) Y.      l.9.Z.`. +.+++N.@+#+I.$+>.@.I t         { %+&+  ",
-"    *+, =+      x w V ;.K.$+6.I.I.p.-+K.;.[.H ;+      >+z ,+    ",
-"      '+_ )+    x S.!+Z.~+d.7.-+-+7.d.~+#.8.9.;+      {+_ ]+    ",
-"      ^+/+,       e s }.$.;.~+`.`.-.;.#.U J S.w     z.' (+_+    ",
-"        ] ) :+    t S.K T [.@.O.O.@.<+U I v ;+    [+` ~ }+      ",
-"        |+1+) 2+    e t 9.I }.T 8.}.G K u e 3+  4+5+' 6+        ",
-"          7+l ) 8+    e ;+u 9.K K 9.v S.f w   9+0+) a+b+        ",
-"            c+d+) N e+f+g+h+;+f e f i+j+k+l+|.~ /+m+            ",
-"              n+D N ! o+p+q+r+s+t+u+v+w+x+y+! X z+              ",
-"                  A+B+X _ ! ~ /+N %+' ) ~ C+Y D+                ",
-"                      E+F+G+H+I+l J+K+L+M+N+                    ",
-"                              O+P+Q+                            ",
-"                                                                "};
diff --git a/applications/osmo4_wx/playlist.xpm b/applications/osmo4_wx/playlist.xpm
deleted file mode 100644 (file)
index cfad2dc..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/* XPM */
-static const char* pl_open[] = {
-"16 16 5 1",
-"  c #000000",
-"! c #808000",
-"# c #C0C0C0",
-"$ c #FFFF00",
-"% c #FFFFFF",
-"################",
-"################",
-"#########   ####",
-"######## ### # #",
-"#############  #",
-"#   ########   #",
-" %$%       #####",
-" $%$%$%$%$ #####",
-" %$%$%$%$% #####",
-" $%$%          #",
-" %$% !!!!!!!!! #",
-" $% !!!!!!!!! ##",
-" % !!!!!!!!! ###",
-"  !!!!!!!!! ####",
-"           #####",
-"################"};
-
-/* XPM */
-static const char* pl_save[] = {
-"16 16 3 1",
-"  c #000000",
-"! c #808000",
-"# c #C0C0C0",
-"################",
-"#              #",
-"# ! ######## # #",
-"# ! ########   #",
-"# ! ######## ! #",
-"# ! ######## ! #",
-"# ! ######## ! #",
-"# ! ######## ! #",
-"# !!        !! #",
-"# !!!!!!!!!!!! #",
-"# !!         ! #",
-"# !!      ## ! #",
-"# !!      ## ! #",
-"# !!      ## ! #",
-"##             #",
-"################"};
-
-/* XPM */
-static const char* pl_add[] = {
-"16 16 2 1",
-"  c #000000",
-"! c #C0C0C0",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!           !!!",
-"!!           !!!",
-"!!           !!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* pl_rem[] = {
-"16 16 2 1",
-"  c #000000",
-"! c #C0C0C0",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!           !!!",
-"!!           !!!",
-"!!           !!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* pl_up[] = {
-"16 16 2 1",
-"  c #000000",
-"! c #C0C0C0",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!! !!!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!     !!!!!!",
-"!!!!       !!!!!",
-"!!!         !!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* pl_down[] = {
-"16 16 2 1",
-"  c #000000",
-"! c #C0C0C0",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!         !!!!",
-"!!!!       !!!!!",
-"!!!!!     !!!!!!",
-"!!!!!!   !!!!!!!",
-"!!!!!!! !!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* pl_sort[] = {
-"16 16 2 1",
-"  c #000000",
-"! c #C0C0C0",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!! !!!!! !!!!!",
-"!!!! !!!!   !!!!",
-"!!!! !!!     !!!",
-"!!!! !!!!! !!!!!",
-"!!!! !!!!! !!!!!",
-"!!!! !!!!! !!!!!",
-"!!!! !!!!! !!!!!",
-"!!     !!! !!!!!",
-"!!!   !!!! !!!!!",
-"!!!! !!!!! !!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
diff --git a/applications/osmo4_wx/resource.h b/applications/osmo4_wx/resource.h
deleted file mode 100644 (file)
index ace6dd4..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by wxOsmo4.rc
-//
-#define IDI_OSMO_ICON                       101
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        104
-#define _APS_NEXT_COMMAND_VALUE         40001
-#define _APS_NEXT_CONTROL_VALUE         1000
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
diff --git a/applications/osmo4_wx/toolbar.xpm b/applications/osmo4_wx/toolbar.xpm
deleted file mode 100644 (file)
index 887d59e..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-/* XPM */
-static const char* tool_open_file[] = {
-"16 16 2 1",
-"  c #000000",
-"! c none",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!  !!!!!!!",
-"!!!!!!    !!!!!!",
-"!!!!!      !!!!!",
-"!!!!        !!!!",
-"!!!          !!!",
-"!!            !!",
-"!!            !!",
-"!!!!!!!!!!!!!!!!",
-"!!            !!",
-"!!            !!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* tool_prev[] = {
-"16 16 3 1",
-"  c #000000",
-"! c none",
-"# c #FF0000",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!  !!",
-"!!!!!!!!!!    !!",
-"!!!!!!!!   ## !!",
-"!!!!!!   #### !!",
-"!!!!   ###### !!",
-"!!!  ######## !!",
-"!!!!    ##### !!",
-"!!!!!!    ### !!",
-"!!!!!!!!    # !!",
-"!!!!!!!!!!    !!",
-"!!!!!!!!!!!!  !!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* tool_next[] = {
-"16 16 3 1",
-"  c #000000",
-"! c none",
-"# c #FF0000",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!  !!!!!!!!!!!!",
-"!!    !!!!!!!!!!",
-"!! ##   !!!!!!!!",
-"!! ####   !!!!!!",
-"!! ######   !!!!",
-"!! ########  !!!",
-"!! ######   !!!!",
-"!! ####   !!!!!!",
-"!! ##   !!!!!!!!",
-"!!    !!!!!!!!!!",
-"!!  !!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* tool_play[] = {
-"16 16 2 1",
-"  c #000000",
-"! c none",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!  !!!!!!!!!!!!",
-"!!    !!!!!!!!!!",
-"!!      !!!!!!!!",
-"!!        !!!!!!",
-"!!          !!!!",
-"!!            !!",
-"!!          !!!!",
-"!!        !!!!!!",
-"!!      !!!!!!!!",
-"!!    !!!!!!!!!!",
-"!!  !!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* tool_pause[] = {
-"16 16 3 1",
-"  c #000000",
-"! c #808080",
-"# c none",
-"################",
-"################",
-"################",
-"###   !##!   ###",
-"###   !##!   ###",
-"###   !##!   ###",
-"###   !##!   ###",
-"###   !##!   ###",
-"###   !##!   ###",
-"###   !##!   ###",
-"###   !##!   ###",
-"###   !##!   ###",
-"###   !##!   ###",
-"###   !##!   ###",
-"################",
-"################"};
-
-
-/* XPM */
-static const char* tool_step[] = {
-"16 16 2 1",
-"  c #000000",
-"! c none",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!   !!!!!!!!!!!",
-"!!     !!!!!!!!!",
-"!!       !!!!!!!",
-"!!!!       !!!!!",
-"!!!!!!       !!!",
-"!!!!!!!!      !!",
-"!!!!!!       !!!",
-"!!!!       !!!!!",
-"!!       !!!!!!!",
-"!!     !!!!!!!!!",
-"!!   !!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-
-/* XPM */
-static const char* tool_stop[] = {
-"16 16 2 1",
-"  c #000000",
-"! c none",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!",
-"!!            !!",
-"!!            !!",
-"!!            !!",
-"!!            !!",
-"!!            !!",
-"!!            !!",
-"!!            !!",
-"!!            !!",
-"!!            !!",
-"!!            !!",
-"!!            !!",
-"!!!!!!!!!!!!!!!!",
-"!!!!!!!!!!!!!!!!"};
-
-/* XPM */
-static const char* tool_info[] = {
-"16 16 3 1",
-"  c #000000",
-"! c none",
-"# c #0000FF",
-"!!!!!!!!!!!!!!!!",
-"!!!!!      !!!!!",
-"!!!          !!!",
-"!!   ######   !!",
-"!  ####!!####  !",
-"!  ####!!####  !",
-"  ############  ",
-"  #####!!#####  ",
-" ######!!#####  ",
-"  #####!!#####  ",
-"  #####!!#####  ",
-"!  ####!!####  !",
-"!  #####!!###  !",
-"!!   ######   !!",
-"!!!          !!!",
-"!!!!!      !!!!!"};
-
-
-/* XPM */
-static const char* tool_config[] = {
-"16 16 3 1",
-"  c #000000",
-"! c #808080",
-"# c none",
-"################",
-"################",
-"##   ##   ######",
-"## ## # ## #  ##",
-"## ##          #",
-"## #!# ####### #",
-"## # #!# ## ## #",
-"## #!# #!# ! # #",
-"## # #!# ## ## #",
-"## #!# #!##### #",
-"## # #!# ## ## #",
-"## #!# #!# ! # #",
-"## # #!# ## ## #",
-"##             #",
-"################",
-"################"};
-
-/* XPM */
-static const char* tool_sw_2d[] = {
-"16 16 4 1",
-"      c #FF0000",
-".     c #C0C0C0",
-"+     c #0000FF",
-"@     c #000000",
-" .............. ",
-". ..++..++++.. .",
-".. +..+..+..+ ..",
-"... ..+..+.. ...",
-".... +...+. +...",
-"...+. +..+ .+...",
-"...+++ .+ ++....",
-".......  .......",
-"....@@ @@ @.....",
-"...@. .@.@ .....",
-"...@ ....@. ....",
-"... ..@@.@.. ...",
-".. @...@.@.@. ..",
-". ..@@@@@@@@.. .",
-" .............. ",
-"................"};
-
-/* XPM */
-static const char* tool_sw_3d[] = {
-"16 16 4 1",
-"      c #FFFFFF",
-".     c #C0C0C0",
-"+     c #0000FF",
-"@     c #000000",
-"                ",
-"................",
-"....++..++++....",
-"...+..+..+..+...",
-"......+..+..+...",
-"....++...+..+...",
-"...+..+..+..+...",
-"...++++.++++....",
-"................",
-"....@@@@@@@.....",
-"...@...@.@......",
-"...@.....@......",
-"...@..@@.@......",
-"...@...@.@.@....",
-"....@@@@@@@@....",
-"................"};
-
diff --git a/applications/osmo4_wx/wxGPACControl.cpp b/applications/osmo4_wx/wxGPACControl.cpp
deleted file mode 100644 (file)
index 7d16802..0000000
+++ /dev/null
@@ -1,1031 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) Jean Le Feuvre 2000-2005
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- *             
- */
-
-#include "wxOsmo4.h"
-#include <gpac/options.h>
-#include <gpac/modules/codec.h>
-#include <gpac/modules/raster2d.h>
-#include <gpac/modules/font.h>
-#include <gpac/modules/audio_out.h>
-#include <gpac/modules/video_out.h>
-
-#include <gpac/iso639.h>
-
-#include "wxGPACControl.h"
-
-
-#define NUM_RATES 11
-static const char *BIFSRates[11] = 
-{
-       "5.0",
-       "7.5",
-       "10.0",
-       "12.5",
-       "15.0",
-       "24.0",
-       "25.0",
-       "30.0",
-       "50.0",
-       "60.0",
-       "100.0"
-};
-
-void wxGPACControl::SetYUVLabel()
-{
-       u32 yuv_format = gf_term_get_option(m_pApp->m_term, GF_OPT_YUV_FORMAT);
-       if (!yuv_format) {
-               m_yuvtxt->SetLabel(wxT("(No YUV used)"));
-       } else {
-               char str[100];
-               sprintf(str, "(%s used)", gf_4cc_to_str(yuv_format));
-               m_yuvtxt->SetLabel(wxString(str, wxConvUTF8) );
-       }
-}
-
-wxGPACControl::wxGPACControl(wxWindow *parent)
-             : wxDialog(parent, -1, wxString(wxT("GPAC Control Panel")))
-{
-       const char *sOpt;
-       SetSize(320, 240);
-       u32 i;
-       wxBoxSizer *bs;
-       Centre();
-
-       m_pApp = (wxOsmo4Frame *)parent;
-
-       s_main = new wxBoxSizer(wxVERTICAL);
-
-       s_header = new wxBoxSizer(wxHORIZONTAL);
-       //s_header->Add(new wxStaticText(this, 0, wxT("Category"), wxDefaultPosition, wxSize(60, 20)), wxALIGN_CENTER);
-       m_select = new wxComboBox(this, ID_SELECT, wxT(""), wxDefaultPosition, wxSize(120, 30), 0, NULL, wxCB_READONLY);
-       s_header->Add(m_select, 2, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_header->Add( new wxButton(this, ID_APPLY, wxT("Apply"), wxDefaultPosition, 
-#ifdef WIN32
-               wxSize(40, 20)
-#else
-               wxSize(40, 30)
-#endif
-               ),
-               1, wxALIGN_TOP|wxALIGN_RIGHT|wxADJUST_MINSIZE);
-       s_main->Add(s_header, 0, wxEXPAND, 0);
-               
-       /*general section*/
-       s_general = new wxBoxSizer(wxVERTICAL);
-       m_loop = new wxCheckBox(this, 0, wxT("Loop at End"), wxPoint(10, 40), wxSize(140, 20));
-       s_general->Add(m_loop);
-       m_lookforsubs = new wxCheckBox(this, 0, wxT("Look for Subtitles"), wxPoint(180, 40), wxSize(140, 20));
-       s_general->Add(m_lookforsubs);
-       m_noconsole = new wxCheckBox(this, 0, wxT("Disable console messages"), wxPoint(10, 80), wxSize(180, 20));
-       s_general->Add(m_noconsole);
-       m_viewxmt = new wxCheckBox(this, 0, wxT("View graph in XMT-A format"), wxPoint(10, 120), wxSize(180, 20));
-       s_general->Add(m_viewxmt);
-       s_main->Add(s_general, 0, wxEXPAND, 0);
-
-       /*MPEG-4 systems*/
-       s_mpeg4 = new wxBoxSizer(wxVERTICAL);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Prefered Stream Language")), wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_lang = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_lang, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_mpeg4->Add(bs, 0, wxALL|wxEXPAND, 2);
-
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Decoder Threading Mode")), wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_thread = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_thread, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_mpeg4->Add(bs, 0, wxALL|wxEXPAND, 2);
-       m_bifsalwaysdrawn = new wxCheckBox(this, 0, wxT("Always draw late BIFS frames"));
-       s_mpeg4->Add(m_bifsalwaysdrawn);
-       m_singletime = new wxCheckBox(this, 0, wxT("Force Single Timeline"));
-       s_mpeg4->Add(m_singletime);
-       s_main->Add(s_mpeg4, 0, wxEXPAND, 0);
-
-       /*media decoders*/
-       s_mdec = new wxBoxSizer(wxVERTICAL);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Prefered Audio Output")), wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_decaudio = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_decaudio, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_mdec->Add(bs, 0, wxALL|wxEXPAND, 2);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Prefered Video Output")), wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_decvideo = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_decvideo, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_mdec->Add(bs, 0, wxALL|wxEXPAND, 2);
-       s_main->Add(s_mdec, 0, wxEXPAND, 0);
-
-       /*Rendering*/
-       s_rend = new wxBoxSizer(wxVERTICAL);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Target Frame Rate")), wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_fps = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_fps, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_rend->Add(bs, 0, wxALL|wxEXPAND, 2);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Anti-Aliasing")), wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_aa = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_aa, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_rend->Add(bs, 0, wxALL|wxEXPAND, 2);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Graphics Driver")), wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_graph = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_graph, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_rend->Add(bs, 0, wxALL|wxEXPAND, 2);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       m_draw_bounds = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(new wxStaticText(this, 0, wxT("Bounds")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
-       bs->Add(m_draw_bounds, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_rend->Add(bs, 0, wxALL|wxEXPAND, 2);
-       m_fast = new wxCheckBox(this, 0, wxT("Fast Rendering"));
-       m_force_size = new wxCheckBox(this, 0, wxT("Force Scene Size"));
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(m_fast, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       bs->Add(m_force_size, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_rend->Add(bs, 0, wxALL|wxEXPAND, 2);
-       m_use3D = new wxCheckBox(this, 0, wxT("Use 3D Renderer"));
-       s_rend->Add(m_use3D, 0, wxALL|wxEXPAND, 2);
-       m_bWas3D = m_use3D->GetValue();
-       s_main->Add(s_rend, 0, wxEXPAND, 0);
-       
-       /*Render 2D*/
-       s_rend2d = new wxBoxSizer(wxVERTICAL);
-       m_direct = new wxCheckBox(this, 0, wxT("Direct Rendering"));
-       s_rend2d->Add(m_direct, 0, wxALL|wxEXPAND, 2);
-       m_scalable = new wxCheckBox(this, 0, wxT("Scalable Zoom"));
-       s_rend2d->Add(m_scalable, 0, wxALL|wxEXPAND, 2);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       m_noyuv = new wxCheckBox(this, 0, wxT("Disable YUV hardware"));
-       bs->Add(m_noyuv, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_yuvtxt = new wxStaticText(this, 0, wxT("(No YUV used)"), wxDefaultPosition, wxSize(60, 20), wxALIGN_LEFT);
-       bs->Add(m_yuvtxt, wxALIGN_CENTER|wxADJUST_MINSIZE);
-       s_rend2d->Add(bs, 0, wxALL|wxEXPAND, 2);
-       s_main->Add(s_rend2d, 0, wxEXPAND, 0);
-
-       /*Render 3D*/
-       s_rend3d = new wxBoxSizer(wxVERTICAL);
-       m_raster_outlines = new wxCheckBox(this, 0, wxT("Use OpenGL Raster outlines"));
-       s_rend3d->Add(m_raster_outlines, 0, wxALL|wxEXPAND, 2);
-       m_polyaa = new wxCheckBox(this, 0, wxT("Enable polygon anti-aliasing"));
-       s_rend3d->Add(m_polyaa, 0, wxALL|wxEXPAND, 2);
-       m_nobackcull = new wxCheckBox(this, 0, wxT("Disable backface culling"));
-       s_rend3d->Add(m_nobackcull, 0, wxALL|wxEXPAND, 2);
-       
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Wireframe mode")), wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_wire = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_wire, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_rend3d->Add(bs, 0, wxALL|wxEXPAND, 2);
-       
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Draw Normals")), wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_normals = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_normals, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_rend3d->Add(bs, 0, wxALL|wxEXPAND, 2);
-
-       m_emulpow2 = new wxCheckBox(this, 0, wxT("Emulate power-of-two textures for video"));
-       s_rend3d->Add(m_emulpow2, 0, wxALL|wxEXPAND, 2);
-       m_norectext = new wxCheckBox(this, 0, wxT("Disable rectangular texture extensions"));
-       s_rend3d->Add(m_norectext, 0, wxALL|wxEXPAND, 2);
-       m_copypixels = new wxCheckBox(this, 0, wxT("Bitmap node uses direct pixel copy"));
-       s_rend3d->Add(m_copypixels, 0, wxALL|wxEXPAND, 2);
-       s_main->Add(s_rend3d, 0, wxEXPAND, 0);
-
-       /*video*/
-       s_video = new wxBoxSizer(wxVERTICAL);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Video Driver")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
-       m_video = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_video , wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_video->Add(bs, 0, wxALL|wxEXPAND, 2);
-       m_switchres = new wxCheckBox(this, 0, wxT("Change video resolution in fullscreen"));
-       s_video->Add(m_switchres, 0, wxALL|wxEXPAND, 2);
-       m_usehwmem = new wxCheckBox(this, 0, wxT("Use hardware memory in 2D mode"));
-       s_video->Add(m_usehwmem, 0, wxALL|wxEXPAND, 2);
-       s_main->Add(s_video, 0, wxEXPAND, 0);
-       
-
-       /*audio*/
-       s_audio = new wxBoxSizer(wxVERTICAL);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Audio Driver")), wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_audio = new wxComboBox(this, ID_AUDIO_DRIVER, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_audio, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_audio->Add(bs, 0, wxALL|wxEXPAND, 2);
-       m_forcecfg = new wxCheckBox(this, ID_FORCE_AUDIO, wxT("Force Audio Config"));
-       m_forcecfg->SetValue(1);
-       s_audio->Add(m_forcecfg, 0, wxALL|wxEXPAND, 2);
-
-
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Number of buffers")), wxALIGN_CENTER|wxADJUST_MINSIZE);
-       m_nbbuf = new wxSpinCtrl(this, -1, wxT(""), wxDefaultPosition, wxSize(20, 20), wxSP_WRAP | wxSP_ARROW_KEYS, 1, 30, 15);
-       m_nbbuf->SetValue(8);
-       bs->Add(m_nbbuf, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_audio->Add(bs, 0, wxALL|wxEXPAND, 2);
-
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Total length in ms")), wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_buflen = new wxSpinCtrl(this, -1, wxT(""), wxDefaultPosition, wxSize(20, 20), wxSP_WRAP | wxSP_ARROW_KEYS, 1, 1000);
-       m_buflen->SetValue(400);
-       bs->Add(m_buflen, wxALIGN_CENTER | wxADJUST_MINSIZE|wxLEFT,10);
-       s_audio->Add(bs, 0, wxALL|wxEXPAND, 2);
-
-       m_noresync = new wxCheckBox(this, -1, wxT("Disable Resynchronization"));
-       s_audio->Add(m_noresync);
-       m_nomulitch = new wxCheckBox(this, -1, wxT("Disable Multichannel"));
-       s_audio->Add(m_nomulitch);
-#ifdef WIN32
-       m_notifs = new wxCheckBox(this, -1, wxT("Disable DirectSound Notifications"));
-       s_audio->Add(m_notifs);
-#endif
-       s_main->Add(s_audio, 0, wxEXPAND, 0);
-       
-       /*font*/
-       s_font = new wxBoxSizer(wxVERTICAL);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Font Engine")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
-       m_font = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_font, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_font->Add(bs, 0, wxALL|wxEXPAND, 2);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("System Font Directory")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
-       m_fontdir = new wxButton(this, ID_FONT_DIR, wxT("..."), wxDefaultPosition, wxDefaultSize);
-       bs->Add(m_fontdir, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_font->Add(bs, 0, wxALL|wxEXPAND, 2);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Text Texturing Mode")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
-       m_texturemode = new wxComboBox(this, 0, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
-       bs->Add(m_texturemode, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_font->Add(bs, 0, wxALL|wxEXPAND, 2);
-       s_main->Add(s_font, 0, wxEXPAND, 0);
-
-       /*download*/
-       s_dnld = new wxBoxSizer(wxVERTICAL);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Cache Directory")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
-       m_cachedir = new wxButton(this, ID_CACHE_DIR, wxT("..."));
-       bs->Add(m_cachedir, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_dnld->Add(bs, 0, wxALL|wxEXPAND, 2);
-       m_cleancache = new wxCheckBox(this, -1, wxT("Remove temp files on exit"));
-       s_dnld->Add(m_cleancache);
-       m_restartcache = new wxCheckBox(this, -1, wxT("Always redownload incomplete cached files"));
-       s_dnld->Add(m_restartcache);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       m_progressive = new wxCheckBox(this, ID_PROGRESSIVE, wxT("XML progressive load"));
-       bs->Add(m_progressive, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_sax_duration = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 120), wxSize(60, 20));
-       bs->Add(m_sax_duration, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       bs->Add(new wxStaticText(this, 0, wxT("max load slice (ms)")), wxADJUST_MINSIZE | wxALIGN_CENTER);
-       s_dnld->Add(bs, 0, wxALL|wxEXPAND, 2);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       m_use_proxy = new wxCheckBox(this, ID_USE_PROXY, wxT("Use proxy"));
-       bs->Add(m_use_proxy, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_proxy_name = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 120), wxSize(60, 20));
-       bs->Add(m_proxy_name, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_dnld->Add(bs, 0, wxALL|wxEXPAND, 2);
-       s_main->Add(s_dnld, 0, wxEXPAND, 0);
-
-       /*streaming*/
-       s_stream = new wxBoxSizer(wxVERTICAL);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Default RTSP port")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
-       m_port = new wxComboBox(this, ID_RTSP_PORT, wxT(""), wxPoint(160, 40), wxSize(140, 30), 0, NULL, wxCB_READONLY);
-       bs->Add(m_port, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_stream->Add(bs, 0, wxALL|wxEXPAND, 2);
-       m_rtsp = new wxCheckBox(this, ID_RTP_OVER_RTSP, wxT("RTP over RTSP"), wxPoint(10, 80), wxSize(140, 20));
-       m_reorder = new wxCheckBox(this, -1, wxT("use RTP reordering"), wxPoint(160, 80), wxSize(130, 20));
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(m_rtsp, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       bs->Add(m_reorder, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_stream->Add(bs, 0, wxALL|wxEXPAND, 2);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       m_timeout = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 120), wxSize(60, 20));
-       bs->Add(new wxStaticText(this, 0, wxT("Control Timeout (ms): ")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
-       bs->Add(m_timeout, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_stream->Add(bs, 0, wxALL|wxEXPAND, 2);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       m_buffer = new wxTextCtrl(this, 0, wxT(""), wxPoint(10, 150), wxSize(60, 20));
-       bs->Add(new wxStaticText(this, 0, wxT("Media Buffering (ms): ")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
-       bs->Add(m_buffer, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_stream->Add(bs, 0, wxALL|wxEXPAND, 2);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       m_dorebuffer = new wxCheckBox(this, ID_RTSP_REBUFFER, wxT("Rebuffer if below"));
-       bs->Add(m_dorebuffer, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_rebuffer = new wxTextCtrl(this, 0, wxT(""), wxPoint(200, 180), wxSize(60, 20));
-       bs->Add(m_rebuffer, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       m_rebuffer->Disable();
-       s_stream->Add(bs, 0, wxALL|wxEXPAND, 2);
-       s_main->Add(s_stream, 0, wxEXPAND, 0);
-
-       /*streaming cache*/
-       s_rec = new wxBoxSizer(wxVERTICAL);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       bs->Add(new wxStaticText(this, 0, wxT("Record To: ")), wxALIGN_CENTER | wxADJUST_MINSIZE | wxALIGN_RIGHT);
-       m_recdir = new wxButton(this, ID_RECORD_DIR, wxT("..."));
-       bs->Add(m_recdir, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_rec->Add(bs, 0, wxALL|wxEXPAND, 2);
-       m_overwrite = new wxCheckBox(this, -1, wxT("Overwrite existing files"));
-       s_rec->Add(m_overwrite);
-       bs = new wxBoxSizer(wxHORIZONTAL);
-       m_usename = new wxCheckBox(this, ID_USE_FILENAME, wxT("Use filename"));
-       m_recfile = new wxTextCtrl(this, 0, wxT(""));
-       bs->Add(m_usename, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       bs->Add(m_recfile, wxALIGN_CENTER | wxADJUST_MINSIZE);
-       s_rec->Add(bs, 0, wxALL|wxEXPAND, 2);
-       s_main->Add(s_rec, 0, wxEXPAND, 0);
-
-       /*load options*/
-       GF_Config *cfg = m_pApp->m_user.config;
-       /*general*/
-       sOpt = gf_cfg_get_key(cfg, "General", "Loop");
-       m_loop->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "General", "LookForSubtitles");
-       m_lookforsubs->SetValue((sOpt && !stricmp(sOpt, "no")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "General", "ConsoleOff");
-       m_noconsole->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "General", "ViewXMT");
-       m_viewxmt->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       /*systems config*/
-       sOpt = gf_cfg_get_key(cfg, "Systems", "Language3CC");
-       if (!sOpt) sOpt = "eng";
-       u32 select = 0;
-       i=0;
-       while (GF_ISO639_Lang[i]) {
-               /*only use common languages (having both 2- and 3-char code names)*/
-               if (GF_ISO639_Lang[i+2][0]) {
-                       m_lang->Append(wxString(GF_ISO639_Lang[i], wxConvUTF8) );
-                       if (sOpt && !stricmp(sOpt, GF_ISO639_Lang[i+1])) select = m_lang->GetCount() - 1;
-               }
-               i+=3;
-       }
-       m_lang->SetSelection(select);
-       sOpt = gf_cfg_get_key(cfg, "Systems", "ThreadingPolicy");
-       select = 0;
-       m_thread->Append(wxT("Single Thread"));
-       m_thread->Append(wxT("Mutli Thread"));
-       if (sOpt && !stricmp(sOpt, "Multi")) select = 1;
-       m_thread->Append(wxT("Free"));
-       if (sOpt && !stricmp(sOpt, "Free")) select = 2;
-       m_thread->SetSelection(select);
-       sOpt = gf_cfg_get_key(cfg, "Systems", "ForceSingleClock");
-       m_singletime->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Systems", "AlwaysDrawBIFS");
-       m_bifsalwaysdrawn->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-
-       /*audio dec enum*/
-       sOpt = gf_cfg_get_key(cfg, "Systems", "DefAudioDec");
-       u32 count = gf_modules_get_count(m_pApp->m_user.modules);
-       GF_BaseDecoder *ifc_d;
-       select = 0;
-       s32 to_sel = 0;
-       for (i=0; i<count; i++) {
-               ifc_d = (GF_BaseDecoder *) gf_modules_load_interface(m_pApp->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
-               if (!ifc_d) continue;
-               if (ifc_d->CanHandleStream(ifc_d, GF_STREAM_AUDIO, NULL, 0)) {
-                       if (sOpt && !stricmp(ifc_d->module_name, sOpt)) select = to_sel;
-                       m_decaudio->Append(wxString(ifc_d->module_name, wxConvUTF8) );
-                       to_sel++;
-               }
-               gf_modules_close_interface((GF_BaseInterface *) ifc_d);
-       }
-       m_decaudio->SetSelection(select);
-
-       /*video dec enum*/
-       sOpt = gf_cfg_get_key(cfg, "Systems", "DefVideoDec");
-       select = to_sel = 0;
-       for (i=0; i<count; i++) {
-               ifc_d = (GF_BaseDecoder *) gf_modules_load_interface(m_pApp->m_user.modules, i, GF_MEDIA_DECODER_INTERFACE);
-               if (!ifc_d) continue;
-               if (ifc_d->CanHandleStream(ifc_d, GF_STREAM_VISUAL, NULL, 0)) {
-                       if (sOpt && !stricmp(ifc_d->module_name, sOpt)) select = to_sel;
-                       m_decvideo->Append(wxString(ifc_d->module_name, wxConvUTF8) );
-                       to_sel++;
-               }
-               gf_modules_close_interface((GF_BaseInterface *) ifc_d);
-       }
-       m_decvideo->SetSelection(select);
-
-       /*rendering FIXME*/
-       m_bWas3D = 0;
-       m_use3D->SetValue(m_bWas3D ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "ForceSceneSize");
-       m_force_size->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "FrameRate");
-       if (!sOpt) sOpt = "30.0";
-       select = 0;
-       for (i = 0; i<NUM_RATES; i++) {
-               m_fps->Append(wxString(BIFSRates[i], wxConvUTF8) );
-               if (sOpt && !stricmp(sOpt, BIFSRates[i]) ) select = i;
-       }
-       m_fps->SetSelection(select);
-       
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "HighSpeed");
-       m_fast->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "AntiAlias");
-       m_aa->Append(wxT("None"));
-       m_aa->Append(wxT("Text only"));
-       m_aa->Append(wxT("Complete"));
-       select = 2;
-       if (sOpt && !stricmp(sOpt, "Text")) select = 1;
-       else if (sOpt && !stricmp(sOpt, "None")) select = 0;
-       m_aa->SetSelection(select);
-
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "BoundingVolume");
-       m_draw_bounds->Append(wxT("None"));
-       m_draw_bounds->Append(wxT("Box/Rect"));
-       m_draw_bounds->Append(wxT("AABB Tree"));
-       select = 0;
-       if (sOpt && !stricmp(sOpt, "Box")) select = 1;
-       else if (sOpt && !stricmp(sOpt, "AABB")) select = 2;
-       m_draw_bounds->SetSelection(select);
-
-       /*render2d*/
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "DirectDraw");
-       m_direct->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "ScalableZoom");
-       m_scalable->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "DisableYUV");
-       m_noyuv->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       SetYUVLabel();
-
-       /*graphics driver enum*/
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "Raster2D");
-       GF_BaseInterface *ifce;
-       select = to_sel = 0;
-       for (i=0; i<count; i++) {
-               ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_RASTER_2D_INTERFACE);
-               if (!ifce) continue;
-               if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
-               m_graph->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) );
-               gf_modules_close_interface(ifce);
-               to_sel++;
-       }
-       m_graph->SetSelection(select);
-
-       /*render3d*/
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "RasterOutlines");
-       m_raster_outlines->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "EmulatePOW2");
-       m_emulpow2->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "PolygonAA");
-       m_polyaa->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "BackFaceCulling");
-       m_nobackcull->SetValue((sOpt && !stricmp(sOpt, "Off")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "Wireframe");
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "BitmapCopyPixels");
-       m_copypixels->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "DisableRectExt");
-       m_norectext->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       m_wire->Append(wxT("No Wireframe"));
-       m_wire->Append(wxT("Wireframe Only"));
-       m_wire->Append(wxT("Solid and Wireframe"));
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "Wireframe");
-       if (sOpt && !stricmp(sOpt, "WireOnly")) m_wire->SetSelection(1);
-       else if (sOpt && !stricmp(sOpt, "WireOnSolid")) m_wire->SetSelection(2);
-       else m_wire->SetSelection(0);
-       m_normals->Append(wxT("Never"));
-       m_normals->Append(wxT("Per Face"));
-       m_normals->Append(wxT("Per Vertex"));
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "DrawNormals");
-       if (sOpt && !stricmp(sOpt, "PerFace")) m_normals->SetSelection(1);
-       else if (sOpt && !stricmp(sOpt, "PerVertex")) m_normals->SetSelection(2);
-       else m_normals->SetSelection(0);
-
-       /*video*/
-       sOpt = gf_cfg_get_key(cfg, "Video", "SwitchResolution");
-       m_switchres->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Video", "UseHardwareMemory");
-       m_usehwmem->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Video", "DriverName");
-       select = to_sel = 0;
-       for (i=0; i<count; i++) {
-               ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_VIDEO_OUTPUT_INTERFACE);
-               if (!ifce) continue;
-               if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
-               m_video->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) );
-               gf_modules_close_interface(ifce);
-               to_sel++;
-       }
-       m_video->SetSelection(select);
-
-       /*audio*/
-       sOpt = gf_cfg_get_key(cfg, "Audio", "ForceConfig");
-       m_forcecfg->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Audio", "NumBuffers");
-       m_nbbuf->SetValue( sOpt ? wxString(sOpt, wxConvUTF8) : wxT("2"));
-       sOpt = gf_cfg_get_key(cfg, "Audio", "TotalDuration");
-       m_buflen->SetValue( sOpt ? wxString(sOpt, wxConvUTF8) : wxT("120"));
-       wxCommandEvent event;
-       ForceAudio(event);
-       sOpt = gf_cfg_get_key(cfg, "Audio", "NoResync");
-       m_noresync->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Audio", "DisableMultiChannel");
-       m_nomulitch->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-
-       /*driver enum*/
-       sOpt = gf_cfg_get_key(cfg, "Audio", "DriverName");
-       select = to_sel = 0;
-       for (i=0; i<count; i++) {
-               ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_AUDIO_OUTPUT_INTERFACE);
-               if (!ifce) continue;
-               if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
-               m_audio->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) );
-               gf_modules_close_interface(ifce);
-               to_sel++;
-       }
-       m_audio->SetSelection(select);
-#ifdef WIN32
-       sOpt = gf_cfg_get_key(cfg, "Audio", "DisableNotification");
-       m_notifs->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       wxCommandEvent audevt;
-       OnSetAudioDriver(audevt);
-#endif
-
-       /*font*/
-       sOpt = gf_cfg_get_key(cfg, "FontEngine", "FontReader");
-       to_sel = select = 0;
-       for (i=0; i<count; i++) {
-               ifce = gf_modules_load_interface(m_pApp->m_user.modules, i, GF_FONT_READER_INTERFACE);
-               if (!ifce) continue;
-               if (sOpt && !stricmp(((GF_BaseInterface *)ifce)->module_name, sOpt)) select = to_sel;
-               m_font->Append(wxString(((GF_BaseInterface *)ifce)->module_name, wxConvUTF8) );
-               gf_modules_close_interface(ifce);
-               to_sel++;
-       }
-       m_font->SetSelection(select);
-       sOpt = gf_cfg_get_key(cfg, "FontEngine", "FontDirectory");
-       if (sOpt) m_fontdir->SetLabel(wxString(sOpt, wxConvUTF8) );
-       sOpt = gf_cfg_get_key(cfg, "Compositor", "TextureTextMode");
-       m_texturemode->Append(wxT("Default"));
-       m_texturemode->Append(wxT("Never"));
-       m_texturemode->Append(wxT("Always"));
-       if (sOpt && !stricmp(sOpt, "Always")) m_texturemode->SetSelection(2);
-       else if (sOpt && !stricmp(sOpt, "3D")) m_texturemode->SetSelection(1);
-       else m_texturemode->SetSelection(0);
-
-       /*downloader*/
-       sOpt = gf_cfg_get_key(cfg, "General", "CacheDirectory");
-       if (sOpt) m_cachedir->SetLabel(wxString(sOpt, wxConvUTF8) );
-       sOpt = gf_cfg_get_key(cfg, "Downloader", "CleanCache");
-       m_cleancache->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "Downloader", "RestartFiles");
-       m_restartcache->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "SAXLoader", "Progressive");
-       m_progressive->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       sOpt = gf_cfg_get_key(cfg, "SAXLoader", "MaxDuration");
-       m_sax_duration->SetValue(sOpt ? wxString(sOpt, wxConvUTF8) : wxT("30"));
-       if (! m_progressive->GetValue()) m_sax_duration->Enable(0);
-
-       sOpt = gf_cfg_get_key(cfg, "HTTPProxy", "Enabled");
-       m_use_proxy->SetValue( (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0);
-       char szProxy[GF_MAX_PATH];
-       strcpy(szProxy, "");
-       sOpt = gf_cfg_get_key(cfg, "HTTPProxy", "Name");
-       if (sOpt) {
-               strcat(szProxy, sOpt);
-               sOpt = gf_cfg_get_key(cfg, "HTTPProxy", "Port");
-               if (sOpt) {
-                       strcat(szProxy, ":");
-                       strcat(szProxy, sOpt);
-               }
-       } else {
-               m_use_proxy->SetValue(0);
-       }
-       m_proxy_name->SetValue( wxString((char *)szProxy, wxConvUTF8) );
-       if (! m_use_proxy->GetValue()) m_proxy_name->Enable(0);
-
-       /*streaming*/   
-       m_port->Append(wxT("554 (RTSP standard)"));
-       m_port->Append(wxT("7070 (RTSP ext)"));
-       m_port->Append(wxT("80 (RTSP / HTTP tunnel)"));
-       m_port->Append(wxT("8080 (RTSP / HTTP tunnel)"));
-       sOpt = gf_cfg_get_key(cfg, "Streaming", "DefaultPort");
-       u32 port = 554;
-       Bool force_rtsp = 0;
-       if (sOpt) port = atoi(sOpt);
-       switch (port) {
-       case 8080:
-               m_port->SetSelection(3);
-               force_rtsp = 1;
-               break;
-       case 80:
-               m_port->SetSelection(2);
-               force_rtsp = 1;
-               break;
-       case 7070:
-               m_port->SetSelection(1);
-               break;
-       default:
-               m_port->SetSelection(0);
-               break;
-       }
-
-       Bool use_rtsp = 0;
-       sOpt = gf_cfg_get_key(cfg, "Streaming", "RTPoverRTSP");
-       if (sOpt && !stricmp(sOpt, "yes")) use_rtsp = 1;
-
-       if (force_rtsp) {
-               m_rtsp->SetValue(1);
-               m_rtsp->Enable(0);
-               m_reorder->SetValue(0);
-               m_reorder->Enable(0);
-       } else {
-               m_rtsp->SetValue(use_rtsp ? 1 : 0);
-               m_rtsp->Enable(1);
-               m_reorder->Enable(1);
-               sOpt = gf_cfg_get_key(cfg, "Streaming", "ReorderSize");
-               m_reorder->SetValue( (sOpt && !stricmp(sOpt, "0")) ? 1 : 0);
-       }
-       sOpt = gf_cfg_get_key(cfg, "Streaming", "RTSPTimeout");
-       m_timeout->SetValue(sOpt ? wxString(sOpt, wxConvUTF8) : wxT("30000"));
-       sOpt = gf_cfg_get_key(cfg, "Network", "BufferLength");
-       m_buffer->SetValue(sOpt ? wxString(sOpt, wxConvUTF8) : wxT("3000"));
-       sOpt = gf_cfg_get_key(cfg, "Network", "RebufferLength");
-       u32 buf_len = 0;
-       if (sOpt) buf_len = atoi(sOpt);
-       if (buf_len) {
-               m_dorebuffer->SetValue(1);
-               m_rebuffer->SetValue(wxString(sOpt, wxConvUTF8));
-               m_rebuffer->Enable(1);
-       } else {
-               m_dorebuffer->SetValue(0);
-               m_rebuffer->SetValue(wxT("0"));
-               m_rebuffer->Enable(0);
-       }
-
-       RTPoverRTSP(event);
-
-       sOpt = gf_cfg_get_key(cfg, "StreamingCache", "RecordDirectory");
-       if (!sOpt) sOpt = gf_cfg_get_key(cfg, "General", "CacheDirectory");
-       if (sOpt) m_recdir->SetLabel(wxString(sOpt, wxConvUTF8));
-       sOpt = gf_cfg_get_key(cfg, "StreamingCache", "KeepExistingFiles");
-       m_overwrite->SetValue((sOpt && !stricmp(sOpt, "yes")) ? 0 : 1);
-
-       sOpt = gf_cfg_get_key(cfg, "StreamingCache", "BaseFileName");
-       if (sOpt) {
-               m_usename->SetValue(1);
-               m_recfile->Enable(1);
-               m_recfile->SetValue(wxString(sOpt, wxConvUTF8));
-       } else {
-               m_usename->SetValue(0);
-               m_recfile->Enable(0);
-               m_recfile->SetValue(wxT("uses service URL"));
-       }
-
-       m_select->Append(wxT("General"));
-       m_select->Append(wxT("MPEG-4 Systems"));
-       m_select->Append(wxT("Media Decoders"));
-       m_select->Append(wxT("Compositor"));
-       m_select->Append(wxT("Renderer 2D"));
-       m_select->Append(wxT("Renderer 3D"));
-       m_select->Append(wxT("Video Output"));
-       m_select->Append(wxT("Audio Output"));
-       m_select->Append(wxT("Text Engine"));
-       m_select->Append(wxT("File Download"));
-       m_select->Append(wxT("Real-Time Streaming"));
-       m_select->Append(wxT("Streaming Cache"));
-
-       sOpt = gf_cfg_get_key(cfg, "General", "ConfigPanel");
-       m_sel = sOpt ? atoi(sOpt) : 0;
-       if (m_sel>11) m_sel=11;
-       m_select->SetSelection(m_sel);
-
-       DoSelect();
-}
-
-BEGIN_EVENT_TABLE(wxGPACControl, wxDialog)
-       EVT_BUTTON(ID_APPLY, wxGPACControl::Apply)
-       EVT_COMBOBOX(ID_SELECT, wxGPACControl::OnSetSelection)
-       EVT_CHECKBOX(ID_FORCE_AUDIO, wxGPACControl::ForceAudio)
-       EVT_COMBOBOX(ID_AUDIO_DRIVER, wxGPACControl::OnSetAudioDriver)
-       EVT_BUTTON(ID_FONT_DIR, wxGPACControl::FontDir)
-       EVT_BUTTON(ID_CACHE_DIR, wxGPACControl::CacheDir)
-       EVT_CHECKBOX(ID_PROGRESSIVE, wxGPACControl::OnProgressive)
-       EVT_CHECKBOX(ID_USE_PROXY, wxGPACControl::OnUseProxy)
-       EVT_CHECKBOX(ID_RTP_OVER_RTSP, wxGPACControl::RTPoverRTSP)
-       EVT_CHECKBOX(ID_RTSP_REBUFFER, wxGPACControl::Rebuffer)
-       EVT_COMBOBOX(ID_RTSP_PORT, wxGPACControl::OnSetRTSPPort)
-       EVT_CHECKBOX(ID_USE_FILENAME, wxGPACControl::OnUseFileName)
-       EVT_BUTTON(ID_RECORD_DIR, wxGPACControl::OnRecDir)
-END_EVENT_TABLE()
-
-
-wxGPACControl::~wxGPACControl()
-{
-       char str[20];
-       sprintf(str, "%d", m_sel);
-       gf_cfg_set_key(m_pApp->m_user.config, "General", "ConfigPanel", str);
-}
-
-
-void wxGPACControl::DoSelect()
-{
-
-       /*hide everything*/
-       s_main->Show(s_general, false);
-       s_main->Show(s_mpeg4, false);
-       s_main->Show(s_mdec, false);
-       s_main->Show(s_rend, false);
-       s_main->Show(s_rend2d, false);
-       s_main->Show(s_rend3d, false);
-       s_main->Show(s_video, false);
-       s_main->Show(s_audio, false);
-       s_main->Show(s_font, false);
-       s_main->Show(s_dnld, false);
-       s_main->Show(s_stream, false);
-       s_main->Show(s_rec, false);
-       switch (m_sel) {
-       case 0: s_main->Show(s_general, true); break;
-       case 1: s_main->Show(s_mpeg4, true); break;
-       case 2: s_main->Show(s_mdec, true); break;
-       case 3: s_main->Show(s_rend, true); break;
-       case 4: s_main->Show(s_rend2d, true); break;
-       case 5: s_main->Show(s_rend3d, true); break;
-       case 6: s_main->Show(s_video, true); break;
-       case 7: s_main->Show(s_audio, true); break;
-       case 8: s_main->Show(s_font, true); break;
-       case 9: s_main->Show(s_dnld, true); break;
-       case 10: s_main->Show(s_stream, true); break;
-       case 11: s_main->Show(s_rec, true); break;
-       }
-    SetSizer(s_main);
-       s_main->Fit(this);
-       //s_main->Layout();
-       return;
-
-}
-
-void wxGPACControl::OnSetSelection(wxCommandEvent &WXUNUSED(event))
-{
-       m_sel = m_select->GetSelection();
-       DoSelect();
-}
-
-void wxGPACControl::FontDir(wxCommandEvent &WXUNUSED(event))
-{
-       wxDirDialog dlg(this);
-       dlg.SetPath(m_fontdir->GetLabel());
-       if (dlg.ShowModal() == wxID_OK) {
-               m_fontdir->SetLabel(dlg.GetPath());
-       }
-}
-void wxGPACControl::CacheDir(wxCommandEvent &WXUNUSED(event))
-{
-       wxDirDialog dlg(this);
-       dlg.SetPath(m_cachedir->GetLabel());
-       if (dlg.ShowModal() == wxID_OK) {
-               m_cachedir->SetLabel(dlg.GetPath());
-       }
-}
-
-void wxGPACControl::OnProgressive(wxCommandEvent &WXUNUSED(event))
-{
-       m_sax_duration->Enable(m_progressive->GetValue() ? 1 : 0);
-}
-
-void wxGPACControl::OnUseProxy(wxCommandEvent &WXUNUSED(event))
-{
-       m_proxy_name->Enable(m_use_proxy->GetValue() ? 1 : 0);
-}
-
-void wxGPACControl::RTPoverRTSP(wxCommandEvent &WXUNUSED(event))
-{
-       m_reorder->Enable(m_rtsp->GetValue() ? 0 : 1);
-}
-
-void wxGPACControl::Rebuffer(wxCommandEvent &WXUNUSED(event))
-{
-       if (m_dorebuffer->GetValue()) {
-               m_rebuffer->Enable();
-       } else {
-               m_rebuffer->Disable();
-       }
-}
-
-void wxGPACControl::OnSetRTSPPort(wxCommandEvent &WXUNUSED(event))
-{
-       if (m_port->GetSelection() > 1) {
-               m_rtsp->Enable(0);
-               m_reorder->Enable(0);
-       } else {
-               m_rtsp->Enable(1);
-               m_reorder->Enable(1);
-       }
-}
-
-void wxGPACControl::OnRecDir(wxCommandEvent &WXUNUSED(event))
-{
-       wxDirDialog dlg(this);
-       dlg.SetPath(m_recdir->GetLabel());
-       if (dlg.ShowModal() == wxID_OK) {
-               m_recdir->SetLabel(dlg.GetPath());
-       }
-}
-
-void wxGPACControl::OnUseFileName(wxCommandEvent &WXUNUSED(event))
-{
-       if (m_usename->GetValue()) {
-               m_recfile->Enable();
-               m_recfile->SetValue(wxT("record"));
-       } else {
-               m_recfile->Disable();
-               m_recfile->SetValue(wxT("uses service URL"));
-       }
-}
-
-void wxGPACControl::ForceAudio(wxCommandEvent &WXUNUSED(event))
-{
-       if (m_forcecfg->GetValue()) {
-               m_nbbuf->Enable();
-               m_buflen->Enable();
-       } else {
-               m_nbbuf->Disable();
-               m_buflen->Disable();
-       }
-}
-
-void wxGPACControl::OnSetAudioDriver(wxCommandEvent &WXUNUSED(event))
-{
-#ifdef WIN32
-       if (strstr(m_audio->GetStringSelection().mb_str(wxConvUTF8), "DirectSound")) {
-               m_notifs->Enable(1);
-       } else {
-               m_notifs->Enable(0);
-       }
-#endif
-}
-
-
-
-void wxGPACControl::Apply(wxCommandEvent &WXUNUSED(event))
-{
-       /*save options*/
-       GF_Config *cfg = m_pApp->m_user.config;
-
-       m_pApp->m_loop = m_loop->GetValue() ? 1 : 0;
-       gf_cfg_set_key(cfg, "General", "Loop", m_loop->GetValue() ? "yes" : "no");
-       m_pApp->m_lookforsubs = m_lookforsubs->GetValue() ? 1 : 0;
-       gf_cfg_set_key(cfg, "General", "LookForSubtitles",  m_lookforsubs->GetValue() ? "yes" : "no");
-       m_pApp->m_console_off = m_noconsole->GetValue() ? 1 : 0;
-       gf_cfg_set_key(cfg, "General", "ConsoleOff", m_noconsole->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "General", "ViewXMT", m_viewxmt->GetValue() ? "yes" : "no");
-
-       s32 sel = m_lang->GetSelection();
-       u32 i=0;
-       while (GF_ISO639_Lang[i]) {
-               /*only use common languages (having both 2- and 3-char code names)*/
-               if (GF_ISO639_Lang[i+2][0]) {
-                       if (!sel) break;
-                       sel--;
-               }
-               i+=3;
-       }
-       gf_cfg_set_key(cfg, "Systems", "LanguageName", GF_ISO639_Lang[i]);
-       gf_cfg_set_key(cfg, "Systems", "Language3CC", GF_ISO639_Lang[i+1]);
-       gf_cfg_set_key(cfg, "Systems", "Language2CC", GF_ISO639_Lang[i+2]);
-
-
-       sel = m_thread->GetSelection();
-       gf_cfg_set_key(cfg, "Systems", "ThreadingPolicy", (sel==0) ? "Single" : ( (sel==1) ? "Multi" : "Free"));
-       gf_cfg_set_key(cfg, "Systems", "ForceSingleClock", m_singletime->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Systems", "AlwaysDrawBIFS", m_bifsalwaysdrawn->GetValue() ? "yes" : "no");
-
-       gf_cfg_set_key(cfg, "Systems", "DefAudioDec", m_decaudio->GetStringSelection().mb_str(wxConvUTF8));
-       gf_cfg_set_key(cfg, "Systems", "DefVideoDec", m_decvideo->GetStringSelection().mb_str(wxConvUTF8));
-       
-
-       gf_cfg_set_key(cfg, "Compositor", "HighSpeed", m_fast->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Compositor", "ForceSceneSize", m_force_size->GetValue() ? "yes" : "no");
-
-       gf_cfg_set_key(cfg, "Compositor", "FrameRate", BIFSRates[m_fps->GetSelection()]);
-       sel = m_aa->GetSelection();
-       gf_cfg_set_key(cfg, "Compositor", "AntiAlias", (sel==0) ? "None" : ( (sel==1) ? "Text" : "All"));
-       sel = m_draw_bounds->GetSelection();
-       gf_cfg_set_key(cfg, "Compositor", "BoundingVolume", (sel==2) ? "AABB" : (sel==1) ? "Box" : "None");
-
-       Bool is_3D = m_use3D->GetValue() ? 1 : 0;
-       if (m_bWas3D != is_3D) {
-               /*FIXME*/
-       }
-       gf_cfg_set_key(cfg, "Compositor", "Raster2D", m_graph->GetStringSelection().mb_str(wxConvUTF8));
-
-       gf_cfg_set_key(cfg, "Compositor", "DirectDraw", m_direct->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Compositor", "ScalableZoom", m_scalable->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Compositor", "DisableYUV", m_noyuv->GetValue() ? "yes" : "no");
-
-       gf_cfg_set_key(cfg, "Compositor", "RasterOutlines", m_raster_outlines->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Compositor", "EmulatePOW2", m_emulpow2->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Compositor", "PolygonAA", m_polyaa->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Compositor", "DisableRectExt", m_norectext->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Compositor", "BitmapCopyPixels", m_copypixels->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Compositor", "BackFaceCulling", m_nobackcull->GetValue() ? "Off" : "On");
-
-       sel = m_wire->GetSelection();
-       gf_cfg_set_key(cfg, "Compositor", "Wireframe", (sel==2) ? "WireOnSolid" : ( (sel==1) ? "WireOnly" : "WireNone" ) );
-       sel = m_normals->GetSelection();
-       gf_cfg_set_key(cfg, "Compositor", "DrawNormals", (sel==2) ? "PerVertex" : ( (sel==1) ? "PerFace" : "Never" ) );
-
-       gf_cfg_set_key(cfg, "Video", "SwitchResolution", m_switchres->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Video", "UseHardwareMemory", m_usehwmem->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Video", "DriverName", m_video->GetStringSelection().mb_str(wxConvUTF8));
-
-
-       gf_cfg_set_key(cfg, "Audio", "ForceConfig", m_forcecfg->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Audio", "NoResync", m_noresync->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Audio", "DisableMultiChannel", m_nomulitch->GetValue() ? "yes" : "no");
-       
-       gf_cfg_set_key(cfg, "Audio", "NumBuffers", wxString::Format(wxT("%d"), m_nbbuf->GetValue()).mb_str(wxConvUTF8) );
-       gf_cfg_set_key(cfg, "Audio", "TotalDuration", wxString::Format(wxT("%d"), m_buflen->GetValue()).mb_str(wxConvUTF8) );
-       gf_cfg_set_key(cfg, "Audio", "DriverName", m_audio->GetStringSelection().mb_str(wxConvUTF8));
-#ifdef WIN32
-       if (m_notifs->IsEnabled()) 
-               gf_cfg_set_key(cfg, "Audio", "DisableNotification", m_notifs->GetValue() ? "yes" : "no");
-#endif
-       
-       gf_cfg_set_key(cfg, "FontEngine", "FontReader", m_font->GetStringSelection().mb_str(wxConvUTF8));
-       gf_cfg_set_key(cfg, "FontEngine", "FontDirectory", m_fontdir->GetLabel().mb_str(wxConvUTF8));
-       switch (m_texturemode->GetSelection()) {
-       case 2: gf_cfg_set_key(cfg, "Compositor", "TextureTextMode", "Always"); break;
-       case 1: gf_cfg_set_key(cfg, "Compositor", "TextureTextMode", "Never"); break;
-       default: gf_cfg_set_key(cfg, "Compositor", "TextureTextMode", "Default"); break;
-       }
-
-       gf_cfg_set_key(cfg, "Downloader", "CleanCache", m_cleancache->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "Downloader", "RestartFiles", m_restartcache->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "SAXLoader", "Progressive", m_progressive->GetValue() ? "yes" : "no");
-       gf_cfg_set_key(cfg, "SAXLoader", "MaxDuration", m_sax_duration->GetLabel().mb_str(wxConvUTF8));
-       gf_cfg_set_key(cfg, "General", "CacheDirectory", m_cachedir->GetLabel().mb_str(wxConvUTF8));
-
-
-       Bool force_rtsp = 0;
-       switch (m_port->GetSelection()) {
-       case 3:
-               gf_cfg_set_key(cfg, "Streaming", "DefaultPort", "8080");
-               force_rtsp = 1;
-               break;
-       case 2:
-               gf_cfg_set_key(cfg, "Streaming", "DefaultPort", "80");
-               force_rtsp = 1;
-               break;
-       case 1:
-               gf_cfg_set_key(cfg, "Streaming", "DefaultPort", "7070");
-               break;
-       default:
-               gf_cfg_set_key(cfg, "Streaming", "DefaultPort", "554");
-               break;
-       }
-
-       if (force_rtsp) {
-               gf_cfg_set_key(cfg, "Streaming", "RTPoverRTSP", "yes");
-       } else {
-               gf_cfg_set_key(cfg, "Streaming", "RTPoverRTSP", m_rtsp->GetValue() ? "yes" : "no");
-               if (!m_rtsp->GetValue()) gf_cfg_set_key(cfg, "Streaming", "ReorderSize", m_dorebuffer->GetValue() ? "30" : "0");
-       }
-
-       gf_cfg_set_key(cfg, "Streaming", "RTSPTimeout", m_timeout->GetValue().mb_str(wxConvUTF8));
-       gf_cfg_set_key(cfg, "Network", "BufferLength", m_buffer->GetValue().mb_str(wxConvUTF8));
-       if (m_dorebuffer->GetValue()) {
-               gf_cfg_set_key(cfg, "Network", "RebufferLength", m_rebuffer->GetValue().mb_str(wxConvUTF8));
-       } else {
-               gf_cfg_set_key(cfg, "Network", "RebufferLength", "0");
-       }
-
-       gf_cfg_set_key(cfg, "StreamingCache", "KeepExistingFiles", m_overwrite->GetValue() ? "no" : "yes");
-       if (m_usename->GetValue()) {
-               gf_cfg_set_key(cfg, "StreamingCache", "BaseFileName", m_recfile->GetValue().mb_str(wxConvUTF8));
-       } else {
-               gf_cfg_set_key(cfg, "StreamingCache", "BaseFileName", NULL);
-       }
-       gf_cfg_set_key(cfg, "StreamingCache", "RecordDirectory", m_recdir->GetLabel().mb_str(wxConvUTF8));
-
-
-       gf_term_set_option(m_pApp->m_term, GF_OPT_RELOAD_CONFIG, 1);
-}
-
diff --git a/applications/osmo4_wx/wxGPACControl.h b/applications/osmo4_wx/wxGPACControl.h
deleted file mode 100644 (file)
index 043d902..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) Jean Le Feuvre 2000-2005
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- *             
- */
-
-#ifndef _OPTIONS_H
-#define _OPTIONS_H
-
-#include "wx/wxprec.h"
-
-#ifndef WX_PRECOMP
-  #include "wx/wx.h"
-#endif
-
-#include <wx/spinbutt.h>
-#include <wx/spinctrl.h>
-
-enum
-{
-       ID_SELECT = 1000,
-       ID_APPLY,
-
-       ID_MAKE_DEF,
-       ID_FORCE_AUDIO,
-       ID_AUDIO_DRIVER,
-       ID_FONT_DIR,
-       ID_CACHE_DIR,
-       ID_PROGRESSIVE,
-       ID_RTSP_PORT,
-       ID_RTP_OVER_RTSP,
-       ID_RTSP_REBUFFER,
-       ID_RECORD_DIR,
-       ID_USE_FILENAME,
-       ID_USE_PROXY,
-};
-
-class wxOsmo4Frame;
-class wxGPACControl : public wxDialog 
-{
-public:
-    wxGPACControl(wxWindow *parent);
-       virtual ~wxGPACControl();
-
-private:
-       DECLARE_EVENT_TABLE()
-
-       wxOsmo4Frame *m_pApp;
-
-       wxComboBox *m_select;
-       Bool m_bWas3D;
-
-       void Apply(wxCommandEvent &event);
-       void OnSetSelection(wxCommandEvent &event);
-       void ForceAudio(wxCommandEvent &event);
-       void OnSetAudioDriver(wxCommandEvent &event);
-       void FontDir(wxCommandEvent &event);
-       void CacheDir(wxCommandEvent &event);
-       void OnProgressive(wxCommandEvent &event);
-       void OnUseProxy(wxCommandEvent &event);
-       void RTPoverRTSP(wxCommandEvent &event);
-       void Rebuffer(wxCommandEvent &event);
-       void OnSetRTSPPort(wxCommandEvent &event);
-       void OnUseFileName(wxCommandEvent &event);
-       void OnRecDir(wxCommandEvent &event);
-       void DoSelect();
-       s32 m_sel;
-       void SetYUVLabel();
-
-       wxBoxSizer *s_header, *s_main, *s_general, *s_mpeg4, *s_mdec, *s_rend, *s_rend2d, *s_rend3d, *s_audio, *s_video, *s_font, *s_dnld, *s_stream, *s_rec;
-
-       /*general section*/
-       wxCheckBox *m_loop, *m_lookforsubs, *m_noconsole, *m_viewxmt;
-       /*MPEG-4 systems*/
-       wxCheckBox *m_bifsalwaysdrawn, *m_singletime;
-       wxComboBox *m_lang, *m_thread;
-       /*media decoders*/
-       wxComboBox *m_decaudio, *m_decvideo;
-       /*Rendering*/
-       wxComboBox *m_fps, *m_aa, *m_draw_bounds;
-       wxCheckBox *m_use3D, *m_fast, *m_force_size;
-       /*Renderer 2D*/
-       wxComboBox *m_graph;
-       wxCheckBox *m_noyuv, *m_direct, *m_scalable;
-       wxStaticText *m_yuvtxt;
-       /*Renderer 3D*/
-       wxCheckBox *m_raster_outlines, *m_polyaa, *m_nobackcull, *m_emulpow2, *m_norectext, *m_copypixels;
-       wxComboBox *m_wire, *m_normals;
-       /*video*/
-       wxComboBox *m_video;
-       wxCheckBox *m_switchres, *m_usehwmem;
-       /*audio*/
-       wxSpinCtrl *m_nbbuf, *m_buflen;
-       wxComboBox *m_audio;
-       wxCheckBox *m_forcecfg, *m_noresync, *m_nomulitch;
-#ifdef WIN32
-       wxCheckBox *m_notifs;
-#endif
-       /*font*/
-       wxComboBox *m_font;
-       wxButton *m_fontdir;
-       wxComboBox *m_texturemode;
-       /*file download*/
-       wxButton *m_cachedir;
-       wxCheckBox *m_cleancache, *m_restartcache, *m_progressive, *m_use_proxy;
-       wxTextCtrl *m_sax_duration, *m_proxy_name;
-       /*streaming*/
-       wxComboBox *m_port;
-       wxCheckBox *m_rtsp, *m_reorder, *m_dorebuffer;
-       wxTextCtrl *m_timeout, *m_buffer, *m_rebuffer;
-       /*file recorder*/
-       wxButton *m_recdir;
-       wxCheckBox *m_overwrite, *m_usename;
-       wxTextCtrl *m_recfile;
-};
-
-#endif
-
diff --git a/applications/osmo4_wx/wxOsmo4.cpp b/applications/osmo4_wx/wxOsmo4.cpp
deleted file mode 100644 (file)
index 5c7767e..0000000
+++ /dev/null
@@ -1,2352 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) Jean Le Feuvre 2000-2005
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- *  GPAC is gf_free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- */
-
-
-#include "wxOsmo4.h"
-#include "wxGPACControl.h"
-#include "fileprops.h"
-#include <wx/image.h>
-#include <gpac/modules/service.h>
-#include <gpac/network.h>
-#include <gpac/constants.h>
-#include <gpac/options.h>
-
-
-IMPLEMENT_APP(wxOsmo4App)
-
-#include "osmo4.xpm"
-
-#include <wx/dnd.h>
-
-
-
-
-
-#include <wx/filename.h>
-#include <wx/clipbrd.h>
-
-#include "toolbar.xpm"
-
-#include "Playlist.h"
-
-#ifdef WIN32
-#define        FRAME_H 140
-#else
-#define        FRAME_H 110
-#endif
-
-
-wxString get_pref_browser(GF_Config *cfg)
-{
-       const char *sOpt = gf_cfg_get_key(cfg, "General", "Browser");
-       if (sOpt) return wxString(sOpt, wxConvUTF8);
-       return wxEmptyString;
-/*
-#ifdef __WXMAC__
-       return wxT("safari");
-#else
-#ifdef WIN32
-       return wxT("explorer.exe");
-#else
-       return wxT("mozilla");
-#endif
-#endif*/
-}
-
-
-IMPLEMENT_DYNAMIC_CLASS(wxGPACEvent, wxEvent )
-
-wxGPACEvent::wxGPACEvent(wxWindow* win)
-{
-    SetEventType(GPAC_EVENT);
-    SetEventObject(win);
-       gpac_evt.type = 0;
-       to_url = wxT("");
-}
-wxEvent *wxGPACEvent::Clone() const
-{
-       wxGPACEvent *evt = new wxGPACEvent((wxWindow *) m_eventObject);
-       evt->to_url = to_url;
-       evt->gpac_evt = gpac_evt;
-       return evt;
-}
-
-#include <wx/wx.h>
-
-/*open file dlg*/
-BEGIN_EVENT_TABLE(OpenURLDlg, wxDialog)
-    EVT_BUTTON(ID_URL_GO, OpenURLDlg::OnGo)
-END_EVENT_TABLE()
-
-OpenURLDlg::OpenURLDlg(wxWindow *parent, GF_Config *cfg)
-             : wxDialog(parent, -1, wxString(wxT("Enter remote presentation location")))
-{
-#ifndef WIN32
-       SetSize(430, 35);
-#else
-       SetSize(430, 55);
-#endif
-       Centre();
-    m_url = new wxComboBox(this, -1, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN);
-       m_url->SetSize(0, 2, 340, 18, wxSIZE_AUTO);
-    m_go = new wxButton(this, ID_URL_GO, wxT("Go !"));
-#ifndef WIN32
-       m_go->SetSize(344, 2, 20, 18, wxSIZE_AUTO);
-#else
-       m_go->SetSize(364, 2, 30, 18, wxSIZE_AUTO);
-#endif
-       m_urlVal = wxT("");
-
-       m_cfg = cfg;
-
-       const char *sOpt;
-       u32 i=0;
-
-       while (1) {
-               sOpt = gf_cfg_get_key_name(m_cfg, "RecentFiles", i);
-               if (!sOpt) break;
-               m_url->Append(wxString(sOpt, wxConvUTF8) );
-               i++;
-       }
-}
-
-#define MAX_LAST_FILES         20
-void UpdateLastFiles(GF_Config *cfg, const char *URL)
-{
-       u32 nb_entries;
-       gf_cfg_set_key(cfg, "RecentFiles", URL, NULL);
-       gf_cfg_insert_key(cfg, "RecentFiles", URL, "", 0);
-       /*remove last entry if needed*/
-       nb_entries = gf_cfg_get_key_count(cfg, "RecentFiles");
-       if (nb_entries>MAX_LAST_FILES) {
-               gf_cfg_set_key(cfg, "RecentFiles", gf_cfg_get_key_name(cfg, "RecentFiles", nb_entries-1), NULL);
-       }
-}
-
-void OpenURLDlg::OnGo(wxCommandEvent& event)
-{
-       m_urlVal = m_url->GetValue();
-       UpdateLastFiles(m_cfg, m_urlVal.mb_str(wxConvUTF8));
-       EndModal(wxID_OK);
-}
-/*end open file dlg*/
-
-#ifdef WIN32
-u32 get_sys_col(int idx)
-{
-       u32 res;
-       DWORD val = GetSysColor(idx);
-       res = (val)&0xFF; res<<=8;
-       res |= (val>>8)&0xFF; res<<=8;
-       res |= (val>>16)&0xFF;
-       return res;
-}
-#endif
-
-static void wxOsmo4_progress_cbk(const void *usr, const char *title, u64 done, u64 total)
-{
-       if (!total) return;
-       wxOsmo4Frame *app = (wxOsmo4Frame *)usr;
-       s32 prog = (s32) ( (100 * (u64)done) / total);
-       if (app->m_last_prog < prog) {
-               app->m_last_prog = prog;
-
-               if (prog<100) {
-                       /*appears to crash wxWidgets / X11 when refreshing the text too often*/
-                       if (app->m_LastStatusTime + 200 > gf_sys_clock()) return;
-                       char msg[1024];
-                       sprintf(msg, "%s %02d %%)", title, prog);
-                       //app->SetStatus(wxString(msg, wxConvUTF8));
-               } else {
-                       app->SetStatus(wxT("Ready"));
-                       app->m_last_prog = -1;
-               }
-       }
-}
-
-Bool GPAC_EventProc(void *ptr, GF_Event *evt)
-{
-       wxCommandEvent event;
-       wxOsmo4Frame *app = (wxOsmo4Frame *)ptr;
-
-       switch (evt->type) {
-       case GF_EVENT_DURATION:
-               app->m_duration = (u32) (evt->duration.duration*1000);
-               app->m_can_seek = evt->duration.can_seek;
-               if (app->m_duration<1100) app->m_can_seek = 0;
-               app->m_pProg->Enable(app->m_can_seek ? 1 : 0);
-               app->m_pPlayList->SetDuration((u32) evt->duration.duration);
-               break;
-       case GF_EVENT_MESSAGE:
-       {
-               const char *servName;
-               if (!evt->message.service || !strcmp(evt->message.service, app->m_pPlayList->GetURL().mb_str(wxConvUTF8))) {
-                       servName = "main service";
-               } else {
-                       servName = evt->message.service;
-               }
-               if (!evt->message.message) return 0;
-
-               if (evt->message.error) {
-                       app->SetStatus(wxString(evt->message.message, wxConvUTF8) + wxT(" (") + wxString(servName, wxConvUTF8) + wxT(")") );
-                       if (!app->m_connected) app->m_pPlayList->SetDead();
-               }
-               else if (!app->m_console_off) {
-                       if (strstr(evt->message.message, "100 %")) {
-                               app->SetStatus(wxT(""));
-                       } else {
-                               app->SetStatus(wxString(evt->message.message, wxConvUTF8) );
-                       }
-               }
-
-#if 0
-               /*log*/
-               if (evt->message.error)
-                       ::wxLogMessage(wxString(evt->message.message, wxConvUTF8) + wxT(" (") + wxString(servName, wxConvUTF8) + wxT(") ") + wxString(gf_error_to_string(evt->message.error), wxConvUTF8) );
-               else
-                       ::wxLogMessage(wxString(evt->message.message, wxConvUTF8) + wxT(" (") + wxString(servName, wxConvUTF8) + wxT(")"));
-#endif
-       }
-               break;
-       case GF_EVENT_PROGRESS:
-       {
-               const char *sTitle;
-               if (evt->progress.progress_type==0) sTitle = (char *)"Buffer";
-               else if (evt->progress.progress_type==1) sTitle = (char *)"Download";
-               else if (evt->progress.progress_type==2) sTitle = (char *)"Import";
-               gf_set_progress(sTitle, evt->progress.done, evt->progress.total);
-       }
-               break;
-       case GF_EVENT_KEYDOWN:
-               if (app->m_can_seek && (evt->key.flags & GF_KEY_MOD_ALT)) {
-                       s32 res;
-                       switch (evt->key.key_code) {
-                       case GF_KEY_LEFT:
-                               res = gf_term_get_time_in_ms(app->m_term) - 5*app->m_duration/100;
-                               if (res<0) res=0;
-                               gf_term_play_from_time(app->m_term, res, 0);
-                               break;
-                       case GF_KEY_RIGHT:
-                               res = gf_term_get_time_in_ms(app->m_term) + 5*app->m_duration/100;
-                               if ((u32) res>=app->m_duration) res = 0;
-                               gf_term_play_from_time(app->m_term, res, 0);
-                               break;
-                       case GF_KEY_DOWN:
-                               res = gf_term_get_time_in_ms(app->m_term) - 60000;
-                               if (res<0) res=0;
-                               gf_term_play_from_time(app->m_term, res, 0);
-                               break;
-                       case GF_KEY_UP:
-                               res = gf_term_get_time_in_ms(app->m_term) + 60000;
-                               if ((u32) res>=app->m_duration) res = 0;
-                               gf_term_play_from_time(app->m_term, res, 0);
-                               break;
-                       }
-               } else if (evt->key.flags & GF_KEY_MOD_CTRL) {
-                       switch (evt->key.key_code) {
-                       case GF_KEY_LEFT:
-                               app->m_pPlayList->PlayPrev();
-                               break;
-                       case GF_KEY_RIGHT:
-                               app->m_pPlayList->PlayNext();
-                               break;
-                       }
-               } else {
-                       switch (evt->key.key_code) {
-                       case GF_KEY_HOME:
-                               gf_term_set_option(app->m_term, GF_OPT_NAVIGATION_TYPE, 1);
-                               break;
-                       case GF_KEY_ESCAPE:
-                               if (gf_term_get_option(app->m_term, GF_OPT_FULLSCREEN))
-                                       gf_term_set_option(app->m_term, GF_OPT_FULLSCREEN, 0);
-                               break;
-                       default:
-                       {
-                               wxGPACEvent wxevt(app);
-                               wxevt.gpac_evt = *evt;
-                               app->AddPendingEvent(wxevt);
-                       }
-                               break;
-                       }
-               }
-               break;
-
-       case GF_EVENT_CONNECT:
-       {
-               wxGPACEvent wxevt(app);
-               wxevt.gpac_evt.type = GF_EVENT_CONNECT;
-               wxevt.gpac_evt.connect.is_connected = evt->connect.is_connected;
-               if (!evt->connect.is_connected) app->m_duration = 0;
-               app->AddPendingEvent(wxevt);
-       }
-               break;
-       case GF_EVENT_NAVIGATE:
-       {
-               wxGPACEvent wxevt(app);
-               wxevt.to_url = wxString(evt->navigate.to_url, wxConvUTF8);
-               wxevt.gpac_evt.type = evt->type;
-               app->AddPendingEvent(wxevt);
-       }
-               return 1;
-       case GF_EVENT_SET_CAPTION:
-       {
-               wxGPACEvent wxevt(app);
-               wxevt.to_url = wxString(evt->caption.caption, wxConvUTF8);
-               wxevt.gpac_evt.type = evt->type;
-               app->AddPendingEvent(wxevt);
-       }
-               return 1;
-
-       case GF_EVENT_QUIT:
-       case GF_EVENT_VIEWPOINTS:
-       case GF_EVENT_STREAMLIST:
-       case GF_EVENT_SCENE_SIZE:
-//     case GF_EVENT_SIZE:
-       {
-               wxGPACEvent wxevt(app);
-               wxevt.gpac_evt = *evt;
-               app->AddPendingEvent(wxevt);
-       }
-               break;
-       case GF_EVENT_DBLCLICK:
-               gf_term_set_option(app->m_term, GF_OPT_FULLSCREEN, !gf_term_get_option(app->m_term, GF_OPT_FULLSCREEN));
-               return 0;
-       case GF_EVENT_MOUSEDOWN:
-               if (!gf_term_get_option(app->m_term, GF_OPT_FULLSCREEN)) {
-#ifdef __WXGTK__
-                 app->m_pVisual->SetFocus();
-#else
-                 app->m_pView->SetFocus();
-#endif
-               }
-               break;
-       case GF_EVENT_AUTHORIZATION:
-       {
-         wxGPACEvent wxevt(app);
-         wxTextEntryDialog user_d (0, 
-                  wxT("Please set the user name for connection"), 
-                 wxString(evt->auth.site_url, wxConvUTF8), 
-                  wxString(evt->auth.user, wxConvUTF8));
-         if (user_d.ShowModal() != wxID_OK)
-           return 0;
-         strncpy(evt->auth.user, user_d.GetValue().mb_str(wxConvUTF8), 50);
-         wxPasswordEntryDialog passwd_d(0, 
-                      wxT("Please enter password"), 
-                      wxString(evt->auth.site_url, wxConvUTF8), 
-                      wxString(evt->auth.password, wxConvUTF8));
-         if (passwd_d.ShowModal() != wxID_OK)
-           return 0;
-         strncpy(evt->auth.password, passwd_d.GetValue().mb_str(wxConvUTF8), 50);
-         return 1;
-       }
-       case GF_EVENT_SYS_COLORS:
-#ifdef WIN32
-               evt->sys_cols.sys_colors[0] = get_sys_col(COLOR_ACTIVEBORDER);
-               evt->sys_cols.sys_colors[1] = get_sys_col(COLOR_ACTIVECAPTION);
-               evt->sys_cols.sys_colors[2] = get_sys_col(COLOR_APPWORKSPACE);
-               evt->sys_cols.sys_colors[3] = get_sys_col(COLOR_BACKGROUND);
-               evt->sys_cols.sys_colors[4] = get_sys_col(COLOR_BTNFACE);
-               evt->sys_cols.sys_colors[5] = get_sys_col(COLOR_BTNHIGHLIGHT);
-               evt->sys_cols.sys_colors[6] = get_sys_col(COLOR_BTNSHADOW);
-               evt->sys_cols.sys_colors[7] = get_sys_col(COLOR_BTNTEXT);
-               evt->sys_cols.sys_colors[8] = get_sys_col(COLOR_CAPTIONTEXT);
-               evt->sys_cols.sys_colors[9] = get_sys_col(COLOR_GRAYTEXT);
-               evt->sys_cols.sys_colors[10] = get_sys_col(COLOR_HIGHLIGHT);
-               evt->sys_cols.sys_colors[11] = get_sys_col(COLOR_HIGHLIGHTTEXT);
-               evt->sys_cols.sys_colors[12] = get_sys_col(COLOR_INACTIVEBORDER);
-               evt->sys_cols.sys_colors[13] = get_sys_col(COLOR_INACTIVECAPTION);
-               evt->sys_cols.sys_colors[14] = get_sys_col(COLOR_INACTIVECAPTIONTEXT);
-               evt->sys_cols.sys_colors[15] = get_sys_col(COLOR_INFOBK);
-               evt->sys_cols.sys_colors[16] = get_sys_col(COLOR_INFOTEXT);
-               evt->sys_cols.sys_colors[17] = get_sys_col(COLOR_MENU);
-               evt->sys_cols.sys_colors[18] = get_sys_col(COLOR_MENUTEXT);
-               evt->sys_cols.sys_colors[19] = get_sys_col(COLOR_SCROLLBAR);
-               evt->sys_cols.sys_colors[20] = get_sys_col(COLOR_3DDKSHADOW);
-               evt->sys_cols.sys_colors[21] = get_sys_col(COLOR_3DFACE);
-               evt->sys_cols.sys_colors[22] = get_sys_col(COLOR_3DHIGHLIGHT);
-               evt->sys_cols.sys_colors[23] = get_sys_col(COLOR_3DLIGHT);
-               evt->sys_cols.sys_colors[24] = get_sys_col(COLOR_3DSHADOW);
-               evt->sys_cols.sys_colors[25] = get_sys_col(COLOR_WINDOW);
-               evt->sys_cols.sys_colors[26] = get_sys_col(COLOR_WINDOWFRAME);
-               evt->sys_cols.sys_colors[27] = get_sys_col(COLOR_WINDOWTEXT);
-               return 1;
-#else
-               memset(evt->sys_cols.sys_colors, 0, sizeof(u32)*28);
-               return 1;
-#endif
-       }
-       return 0;
-}
-
-
-
-bool wxOsmo4App::OnInit()
-{
-#ifdef __WXGTK__
-       XSynchronize((Display *) wxGetDisplay(), 1);
-#endif
-       wxFrame *frame = new wxOsmo4Frame();
-       frame->Show(TRUE);
-       SetTopWindow(frame);
-       return true;
-}
-
-
-class myDropfiles : public wxFileDropTarget
-{
-public:
-       myDropfiles() : wxFileDropTarget() {}
-       virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
-       wxOsmo4Frame *m_pMain;
-};
-
-bool myDropfiles::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames)
-{
-       u32 count = filenames.GetCount();
-
-       if (count==1) {
-               const char *ext = strrchr(filenames.Item(0).mb_str(wxConvUTF8) , '.');
-               /*if playing and sub d&d, open sub in current presentation*/
-               if (m_pMain->m_connected && ext && ( !stricmp(ext, ".srt") || !stricmp(ext, ".sub") || !stricmp(ext, ".ttxt") || !stricmp(ext, ".xml") ) ) {
-                       m_pMain->AddSubtitle(filenames.Item(0).mb_str(wxConvUTF8) , 1);
-                       return TRUE;
-               }
-       }
-
-       for (u32 i=0; i<count; i++)
-               m_pMain->m_pPlayList->QueueURL(filenames.Item(i));
-
-       m_pMain->m_pPlayList->RefreshList();
-       m_pMain->m_pPlayList->PlayNext();
-       return TRUE;
-}
-
-bool GPACLogs::OnFrameClose(wxFrame *frame)
-{
-       Show(FALSE);
-       return 0;
-}
-
-void wxOsmo4Frame::ShowViewWindow(Bool do_show)
-{
-       m_pView->Show(do_show ? 1 : 0);
-#ifdef __WXGTK__
-       //m_pView->Show(0);
-#endif
-}
-
-#ifdef __WXGTK__
-extern "C" {
-#ifdef __WXGTK20__
-    int gdk_x11_drawable_get_xid( void * );
-    void *gdk_x11_drawable_get_xdisplay( void * );
-#endif
-    void *gtk_widget_get_parent_window( void * );
-}
-#endif
-
-
-void wxOsmo4Frame::CheckVideoOut()
-{
-       const char *sOpt = gf_cfg_get_key(m_user.config, "Video", "DriverName");
-       void *os_handle = NULL;
-       void *os_display = NULL;
-       /*build a child window for embed display*/
-       if (sOpt && stricmp(sOpt, "SDL Video Output")) {
-               if (m_user.os_window_handler) return;
-               m_bExternalView = 0;
-
-#ifdef __WXGTK__
-               GtkWidget* widget = m_pVisual->GetHandle();
-
-#ifdef __WXGTK20__
-               os_handle = (void *) gdk_x11_drawable_get_xid(gtk_widget_get_parent_window(widget));
-#else
-               os_handle = (void *)*(int *)( (char *)gtk_widget_get_parent_window(widget) + 2 * sizeof(void *) );
-#endif
-
-#elif defined (WIN32)
-               os_handle = m_pView->GetHandle();
-#endif
-               if (os_handle) {
-                       m_user.os_window_handler = os_handle;
-                       m_user.os_display = os_display;
-                       ShowViewWindow(1);
-                       m_pView->SetSize(320, 240);
-                       SetSize(wxSize(320, 240+FRAME_H));
-                       SetWindowStyle(wxDEFAULT_FRAME_STYLE);
-                       DoLayout(320, 240);
-                       return;
-               }
-       }
-       /*we're using SDL, don't use SDL hack*/
-       m_bExternalView = 1;
-       m_user.os_window_handler = 0;
-       m_user.os_display = NULL;
-       SetSize(wxSize(320,FRAME_H));
-       m_pView->SetSize(0, 0);
-       ShowViewWindow(0);
-       DoLayout();
-       SetWindowStyle(wxDEFAULT_FRAME_STYLE & ~(wxMAXIMIZE_BOX | wxRESIZE_BORDER));
-}
-
-static void wxOsmo4_do_log(void *cbk, u32 level, u32 tool, const char *fmt, va_list list)
-{
-       wxOsmo4Frame *osmo = (wxOsmo4Frame *)cbk;
-
-       if (osmo->m_logs) {
-               vfprintf(osmo->m_logs, fmt, list);
-               fflush(osmo->m_logs);
-       } else {
-               ::wxVLogMessage(wxString(fmt, wxConvUTF8), list);
-       }
-}
-
-
-Bool wxOsmo4Frame::LoadTerminal()
-{
-       m_term = NULL;
-       memset(&m_user, 0, sizeof(GF_User));
-
-       /*locate exec dir for cfg file*/
-    wxPathList pathList;
-       wxString currentDir(wxGetCwd());
-    wxString abs_gpac_path = wxT("");
-       char *gpac_cfg, *sep;
-
-       ::wxLogMessage(wxT("Looking for GPAC configuration file"));
-
-       /*load config*/
-       Bool first_launch = 0;
-       m_user.config = gf_cfg_init(NULL, &first_launch);
-
-       if (!m_user.config) {
-               wxMessageDialog(NULL, wxT("Cannot open GPAC configuration file"), wxT("Init error"), wxOK);
-               return 0;
-       }
-
-       gpac_cfg = gf_cfg_get_filename(m_user.config);
-       sep = strrchr(gpac_cfg, '/');
-       if (!sep) sep = strrchr(gpac_cfg, '\\');
-       if (sep) sep[0] = 0;
-       strcpy(szAppPath, gpac_cfg);
-       if (sep) sep[0] = '/';
-       gf_free(gpac_cfg);
-
-       /*check log file*/
-       const char *str = gf_cfg_get_key(m_user.config, "General", "LogFile");
-       if (str) m_logs = fopen(str, "wt");
-       gf_log_set_callback(this, wxOsmo4_do_log);
-
-       /*set log level*/
-       m_log_level = gf_log_parse_level( gf_cfg_get_key(m_user.config, "General", "LogLevel") );
-       gf_log_set_level(m_log_level);
-
-       /*set log tools*/
-       m_log_tools = gf_log_parse_tools( gf_cfg_get_key(m_user.config, "General", "LogTools")  );
-       gf_log_set_tools(m_log_tools);
-
-       gf_sys_init(0);
-
-       ::wxLogMessage(wxT("GPAC configuration file opened - looking for modules"));
-
-       m_user.modules = gf_modules_new(str, m_user.config);
-       /*initial launch*/
-       if (!m_user.modules || !gf_modules_get_count(m_user.modules)) {
-               wxMessageDialog(NULL, wxT("No modules available - system cannot work"), wxT("Fatal Error"), wxOK).ShowModal();
-               if (m_user.modules) gf_modules_del(m_user.modules);
-               gf_cfg_del(m_user.config);
-               m_user.config = NULL;
-               return 0;
-       }
-
-       if (first_launch) {
-               u32 i;
-               for (i=0; i<gf_modules_get_count(m_user.modules); i++) {
-                       GF_InputService *ifce = (GF_InputService *) gf_modules_load_interface(m_user.modules, i, GF_NET_CLIENT_INTERFACE);
-                       if (!ifce) continue;
-                       if (ifce) {
-                               ifce->CanHandleURL(ifce, "test.test");
-                               gf_modules_close_interface((GF_BaseInterface *) ifce);
-                       }
-               }
-       }
-
-
-
-       ::wxLogMessage(wxT("%d modules found:"), gf_modules_get_count(m_user.modules));
-       for (u32 i=0; i<gf_modules_get_count(m_user.modules); i++) {
-               ::wxLogMessage(wxT("\t") + wxString(gf_modules_get_file_name(m_user.modules, i), wxConvUTF8) );
-       }
-
-       ::wxLogMessage(wxT("Starting GPAC Terminal"));
-       /*now load terminal*/
-       m_user.opaque = this;
-       m_user.EventProc = GPAC_EventProc;
-
-       CheckVideoOut();
-
-       m_term = gf_term_new(&m_user);
-       if (!m_term) {
-               wxMessageDialog(NULL, wxT("Fatal Error"), wxT("Cannot load GPAC Terminal"), wxOK).ShowModal();
-               return 0;
-       } else {
-               ::wxLogMessage(wxT("GPAC Terminal started") );
-       }
-       return 1;
-}
-
-
-
-wxOsmo4Frame::wxOsmo4Frame() :
-               wxFrame((wxFrame *) NULL, -1, wxT("Osmo4 - GPAC"), wxPoint(-1, -1), wxSize(320, FRAME_H), //wxDEFAULT_FRAME_STYLE & ~(wxMAXIMIZE_BOX | wxRESIZE_BORDER)
-wxDEFAULT_FRAME_STYLE
-               )
-
-{
-       int ws[3];
-       m_Address = NULL;
-       m_pView = NULL;
-       m_term = NULL;
-       SetIcon(wxIcon(osmo4));
-       m_bExternalView = 0;
-       m_last_prog = -1;
-       m_num_chapters = 0;
-       m_chapters_start = NULL;
-       m_bViewRTI = 0;
-       m_logs = NULL;
-       m_bStartupFile = 0;
-       gf_set_progress_callback(this, wxOsmo4_progress_cbk);
-
-       myDropfiles *droptarget = new myDropfiles();
-       droptarget->m_pMain = this;
-       SetDropTarget(droptarget);
-       m_pLogs = new GPACLogs(this);
-       m_bGrabbed = 0;
-
-       /*new menu bar*/
-       wxMenuBar *b = new wxMenuBar();
-       /*file*/
-       wxMenu *menu = new wxMenu();
-       menu->Append(GWX_FILE_OPEN, wxT("&Open File\tCtrl+O"), wxT("Open local presentation"));
-       menu->Append(GWX_FILE_OPEN_URL, wxT("&Open URL\tCtrl+U"), wxT("Open remote presentation"));
-       menu->AppendSeparator();
-       menu->Append(FILE_PROPERTIES, wxT("&Properties\tCtrl+I"), wxT("Show presentation properties"));
-       menu->Enable(FILE_PROPERTIES, 0);
-       wxMenu *smenu = new wxMenu();
-       smenu->Append(ID_MCACHE_ENABLE, wxT("&Enable"), wxT("Turns Recorder On/Off"));
-       smenu->Append(ID_MCACHE_STOP, wxT("&Stop"), wxT("Stops recording and saves"));
-       smenu->Append(ID_MCACHE_ABORT, wxT("&Abort"), wxT("Stops recording and discards"));
-       menu->Append(0, wxT("&Streaming Cache"), smenu);
-       menu->AppendSeparator();
-       menu->Append(FILE_COPY, wxT("&Copy\tCtrl+C"), wxT("Copy selected text"));
-       menu->Append(FILE_PASTE, wxT("&Paste\tCtrl+V"), wxT("Copy selected text"));
-       menu->AppendSeparator();
-       menu->Append(FILE_QUIT, wxT("E&xit"), wxT("Quit the application"));
-       b->Append(menu, wxT("&File"));
-       /*view*/
-       menu = new wxMenu();
-       vp_list = new wxMenu();
-       menu->Append(0, wxT("&Viewpoint"), vp_list);
-       smenu = new wxMenu();
-       smenu->Append(ID_HEADLIGHT, wxT("Headlight"), wxT("Turns headlight on/off"), wxITEM_CHECK);
-       smenu->AppendSeparator();
-       smenu->Append(ID_NAVIGATE_NONE, wxT("None"), wxT("Disables Navigation"), wxITEM_CHECK);
-       smenu->Append(ID_NAVIGATE_WALK, wxT("Walk"), wxT("Walk Navigation"), wxITEM_CHECK);
-       smenu->Append(ID_NAVIGATE_FLY, wxT("Fly"), wxT("Fly Navigation"), wxITEM_CHECK);
-       smenu->Append(ID_NAVIGATE_EXAMINE, wxT("Examine"), wxT("Examine Navigation"), wxITEM_CHECK);
-       smenu->Append(ID_NAVIGATE_PAN, wxT("Pan"), wxT("Pan Navigation"), wxITEM_CHECK);
-       smenu->Append(ID_NAVIGATE_SLIDE, wxT("Slide"), wxT("Slide Navigation"), wxITEM_CHECK);
-       smenu->Append(ID_NAVIGATE_ORBIT, wxT("Orbit"), wxT("Orbit Navigation"), wxITEM_CHECK);
-       smenu->Append(ID_NAVIGATE_GAME, wxT("Game"), wxT("Game Navigation"), wxITEM_CHECK);
-       smenu->AppendSeparator();
-       wxMenu *ssmenu = new wxMenu();
-       ssmenu->Append(ID_COLLIDE_NONE, wxT("None"), wxT("No Collision detection"), wxITEM_CHECK);
-       ssmenu->Append(ID_COLLIDE_REG, wxT("Regular"), wxT("Regular Collision detection"), wxITEM_CHECK);
-       ssmenu->Append(ID_COLLIDE_DISP, wxT("Displacement"), wxT("Collision detecion with camera displacement"), wxITEM_CHECK);
-       smenu->Append(0, wxT("&Collision"), ssmenu);
-       smenu->Append(ID_GRAVITY, wxT("Gravity"), wxT("Turns gravity on/off"), wxITEM_CHECK);
-       smenu->AppendSeparator();
-       smenu->Append(ID_NAVIGATE_RESET, wxT("Reset"), wxT("Reset Navigation"));
-
-       menu->Append(0, wxT("&Navigation"), smenu);
-       menu->AppendSeparator();
-       menu->Append(VIEW_FULLSCREEN, wxT("&Fullscreen"), wxT("Toggles Fullscreen"), wxITEM_CHECK);
-       menu->Append(VIEW_ORIGINAL, wxT("&Original Size"), wxT("Restore original size"));
-       smenu = new wxMenu();
-       smenu->Append(VIEW_AR_KEEP, wxT("Keep Original\tCtrl+1"), wxT("Keep original aspect ratio"), wxITEM_CHECK);
-       smenu->Append(VIEW_AR_FILL, wxT("Fill Screen\tCtrl+2"), wxT("Stretch presentation to fill screen"), wxITEM_CHECK);
-       smenu->Append(VIEW_AR_43, wxT("Ratio 4/3\tCtrl+3"), wxT("Force aspect ratio to 4/3"), wxITEM_CHECK);
-       smenu->Append(VIEW_AR_169, wxT("Ratio 16/9\tCtrl+4"), wxT("Force aspect ratio to 16/9"), wxITEM_CHECK);
-       menu->Append(0, wxT("&Aspect Ratio"), smenu);
-       smenu->Check(VIEW_AR_KEEP, 1);
-       menu->AppendSeparator();
-       menu->Append(VIEW_OPTIONS, wxT("&Options"), wxT("View Options"));
-       menu->AppendSeparator();
-       menu->Append(VIEW_RTI, wxT("&Resource Usage"), wxT("View Resource Usage"), wxITEM_CHECK);
-       menu->Append(VIEW_LOGS, wxT("&Logs"), wxT("View GPAC logs"));
-       b->Append(menu, wxT("&View"));
-
-       /*play*/
-       menu = new wxMenu();
-       sel_menu = new wxMenu();
-       sel_menu->Append(0, wxT("&Audio"), new wxMenu());
-       sel_menu->Append(0, wxT("&Video"), new wxMenu());
-       sel_menu->Append(0, wxT("&Subtitles"), new wxMenu());
-       sel_menu->AppendSeparator();
-       sel_menu->Append(ID_ADD_SUB, wxT("&Add Subtitle"), wxT("Adds subtitle"));
-       menu->Append(ID_STREAM_MENU, wxT("&Streams Selection"), sel_menu);
-       chap_menu = new wxMenu();
-       menu->Append(ID_CHAPTER_MENU, wxT("&Chapters"), chap_menu);
-
-       menu->AppendSeparator();
-       menu->Append(VIEW_PLAYLIST, wxT("&Playlist\tCtrl+L"), wxT("Show navigation history as playlist"), wxITEM_CHECK);
-       menu->Append(ID_CLEAR_NAV, wxT("&Clear History"), wxT("Clear navigation history"));
-       menu->AppendSeparator();
-       menu->Append(FILE_PLAY, wxT("&Play/Pause\tCtrl+P"), wxT("Play/Pause/Resume Presentation"));
-       menu->Append(FILE_STEP, wxT("&Step-by-Step\tCtrl+S"), wxT("Play/Pause/Resume Presentation"));
-       menu->Append(FILE_STOP, wxT("&Stop"), wxT("Stop Presentation"));
-       menu->AppendSeparator();
-       menu->Append(FILE_RELOAD_CONFIG, wxT("&Reload Config\tCtrl+R"), wxT("Reload Configuration File"));
-       menu->Append(FILE_RELOAD, wxT("&Reload File\tCtrl+R"), wxT("Reload Presentation"));
-       b->Append(menu, wxT("&Play"));
-
-       menu = new wxMenu();
-       menu->Append(APP_SHORTCUTS, wxT("&Shortcuts"), wxT("Show keyboard shortcuts"));
-       menu->Append(APP_NAV_KEYS, wxT("&Navigation Keys"), wxT("Show navigation keys"));
-       menu->AppendSeparator();
-       menu->Append(APP_ABOUT, wxT("&About"), wxT("Display information and copyright"));
-       b->Append(menu, wxT("&?"));
-
-       SetMenuBar(b);
-
-       m_pStatusbar = CreateStatusBar(1, 0, -1, wxT("statusBar"));
-       ws[0] = 60;
-       ws[1] = 70;
-       ws[2] = -1;
-       m_pStatusbar->SetFieldsCount(3, ws);
-
-       SetStatusBarPane(2);
-       wxColour foreCol = m_pStatusbar->GetBackgroundColour();
-       SetBackgroundColour(foreCol);
-
-
-       m_pTimer = new wxTimer();
-       m_pTimer->SetOwner(this, ID_CTRL_TIMER);
-       m_bGrabbed = 0;
-
-       /*create toolbar*/
-       m_pToolBar = CreateToolBar(wxTB_FLAT|wxTB_HORIZONTAL);
-       m_pOpenFile = new wxBitmap(tool_open_file);
-       m_pPrev = new wxBitmap(tool_prev);
-       m_pNext = new wxBitmap(tool_next);
-       m_pPlay = new wxBitmap(tool_play);
-       m_pPause = new wxBitmap(tool_pause);
-       m_pStep = new wxBitmap(tool_step);
-       m_pStop = new wxBitmap(tool_stop);
-       m_pInfo = new wxBitmap(tool_info);
-       m_pConfig = new wxBitmap(tool_config);
-       m_pSW2D = new wxBitmap(tool_sw_2d);
-       m_pSW3D = new wxBitmap(tool_sw_3d);
-
-       m_pToolBar->AddTool(GWX_FILE_OPEN, wxT(""), *m_pOpenFile, wxT("Open File"));
-       m_pToolBar->AddSeparator();
-       m_pPrevBut = new wxMenuButton(m_pToolBar, FILE_PREV, *m_pPrev);
-       m_pPrevBut->SetToolTip(wxT("Previous Location"));
-       m_pToolBar->AddControl(m_pPrevBut);
-       m_pNextBut = new wxMenuButton(m_pToolBar, FILE_NEXT, *m_pNext);
-       m_pNextBut->SetToolTip(wxT("Next Location"));
-       m_pToolBar->AddControl(m_pNextBut);
-
-       m_pToolBar->AddSeparator();
-       m_pToolBar->AddTool(FILE_PLAY, wxT(""), *m_pPlay, wxT("Play/Pause File"));
-       m_pToolBar->AddTool(FILE_STEP, wxT(""), *m_pStep, wxT("Step-by-Step Mode"));
-       m_pToolBar->AddTool(FILE_STOP, wxT(""), *m_pStop, wxT("Stop File"));
-       m_pToolBar->AddSeparator();
-       m_pToolBar->AddTool(FILE_PROPERTIES, wxT(""), *m_pInfo, wxT("Show File Information"));
-       m_pToolBar->AddSeparator();
-       m_pToolBar->AddTool(VIEW_OPTIONS, wxT(""), *m_pConfig, wxT("GPAC Configuration"));
-       m_pToolBar->AddTool(SWITCH_RENDER, wxT(""), *m_pSW3D, wxT("Switch 2D/3D Renderers"));
-
-       m_pToolBar->Realize();
-
-       m_Address = new wxMyComboBox(this, ID_ADDRESS, wxT(""), wxPoint(50, 0), wxSize(80, 20));
-       wxStaticText *add_text = new wxStaticText(this, -1, wxT("URL"), wxPoint(0, 0), wxSize(40, 20));
-       add_text->SetBackgroundColour(foreCol);
-
-       m_pAddBar = new wxBoxSizer(wxHORIZONTAL);
-       m_pAddBar->Add(add_text, 0, wxALIGN_TOP);
-       m_pAddBar->Add(m_Address, 2, wxALIGN_CENTER|wxEXPAND|wxADJUST_MINSIZE);
-       m_pAddBar->SetMinSize(80, 32);
-       m_pAddBar->Layout();
-
-       m_pProg = new wxSlider(this, ID_SLIDER, 0, 0, 1000, wxPoint(0, 22), wxSize(80, 22), wxSL_HORIZONTAL|wxSUNKEN_BORDER);
-       m_pProg->Enable(0);
-       m_pProg->Show();
-       m_pProg->SetBackgroundColour(foreCol);
-
-       m_pView = new wxWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER);
-       m_pView->SetBackgroundColour(wxColour(wxT("BLACK")));
-#ifdef __WXGTK__
-       m_pVisual = new wxWindow(m_pView, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER);
-       m_pVisual->SetBackgroundColour(wxColour(wxT("BLACK")));
-#endif
-
-       m_pPlayList = new wxPlaylist(this);
-       m_pPlayList->SetIcon(wxIcon(osmo4));
-       m_pPlayList->Hide();
-       Raise();
-       Show();
-
-       m_connected = 0;
-       if (!LoadTerminal()) {
-               Close(TRUE);
-               return;
-       }
-
-
-
-       if (m_bExternalView) SetWindowStyle(wxDEFAULT_FRAME_STYLE & ~(wxMAXIMIZE_BOX | wxRESIZE_BORDER));
-       DoLayout(320, 240);
-       UpdateRenderSwitch();
-
-       const char *sOpt = gf_cfg_get_key(m_user.config, "General", "ConsoleOff");
-       m_console_off = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
-       sOpt = gf_cfg_get_key(m_user.config, "General", "Loop");
-       m_loop = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
-       sOpt = gf_cfg_get_key(m_user.config, "General", "LookForSubtitles");
-       m_lookforsubs = (sOpt && !stricmp(sOpt, "yes")) ? 1 : 0;
-       gf_term_set_option(m_term, GF_OPT_AUDIO_VOLUME, 100);
-
-       ReloadURLs();
-       Raise();
-       m_pStatusbar->SetStatusText(wxT("Ready"), 2);
-       m_LastStatusTime = 0;
-
-       m_pPrevBut->Refresh();
-       m_pNextBut->Refresh();
-
-       wxOsmo4App &app = wxGetApp();
-       if (app.argc>1) {
-               m_pPlayList->QueueURL(wxString(app.argv[1]));
-               m_pPlayList->RefreshList();
-               m_pPlayList->PlayNext();
-       } else {
-               char sPL[GF_MAX_PATH];
-               strcpy((char *) sPL, szAppPath);
-#ifdef WIN32
-               strcat(sPL, "gpac_pl.m3u");
-#else
-               strcat(sPL, ".gpac_pl.m3u");
-#endif
-               m_pPlayList->OpenPlaylist(wxString(sPL, wxConvUTF8) );
-               const char *sOpt = gf_cfg_get_key(m_user.config, "General", "PLEntry");
-               if (sOpt) {
-                       m_pPlayList->m_cur_entry = atoi(sOpt);
-                       if (m_pPlayList->m_cur_entry>=(s32)gf_list_count(m_pPlayList->m_entries))
-                               m_pPlayList->m_cur_entry = -1;
-               }
-
-               sOpt = gf_cfg_get_key(m_user.config, "General", "StartupFile");
-               if (sOpt) {
-                       gf_term_connect(m_term, sOpt);
-                       m_bStartupFile = 1;
-               }
-       }
-
-       sOpt = gf_cfg_get_key(m_user.config, "Audio", "DriverName");
-
-       if (!strcmp(sOpt, "No Audio Output Available")) {
-         ::wxLogMessage(wxT("WARNING: no audio output availble - make sure no other program is locking the sound card"));
-         SetStatus(wxT("No audio ouput available"));
-
-       } else {
-         SetStatus(wxT("Ready"));
-       }
-}
-
-wxOsmo4Frame::~wxOsmo4Frame()
-{
-       vp_list = NULL;
-       sel_menu = NULL;
-
-       if (m_user.modules) gf_modules_del(m_user.modules);
-       gf_sys_close();
-       if (m_user.config) gf_cfg_del(m_user.config);
-
-       if (m_chapters_start) gf_free(m_chapters_start);
-       if (m_pView) delete m_pView;
-
-       //m_pToolBar->RemoveTool(FILE_PREV);
-       //m_pToolBar->RemoveTool(FILE_NEXT);
-
-       delete m_pPrevBut;
-       delete m_pNextBut;
-       delete m_pPlayList;
-       delete m_pTimer;
-       delete m_pOpenFile;
-       delete m_pPrev;
-       delete m_pNext;
-       delete m_pPlay;
-       delete m_pPause;
-       delete m_pStep;
-       delete m_pStop;
-       delete m_pInfo;
-       delete m_pConfig;
-       delete m_pSW2D;
-       delete m_pSW3D;
-}
-
-
-BEGIN_EVENT_TABLE(wxOsmo4Frame, wxFrame)
-       EVT_CLOSE(wxOsmo4Frame::OnCloseApp)
-       EVT_MENU(GWX_FILE_OPEN, wxOsmo4Frame::OnFileOpen)
-       EVT_MENU(GWX_FILE_OPEN_URL, wxOsmo4Frame::OnFileOpenURL)
-       EVT_MENU(FILE_RELOAD_CONFIG, wxOsmo4Frame::OnFileReloadConfig)
-       EVT_MENU(FILE_RELOAD, wxOsmo4Frame::OnFileReload)
-       EVT_MENU(FILE_PROPERTIES, wxOsmo4Frame::OnFileProperties)
-       EVT_MENU(FILE_QUIT, wxOsmo4Frame::OnFileQuit)
-       EVT_MENU(VIEW_FULLSCREEN, wxOsmo4Frame::OnFullScreen)
-       EVT_MENU(VIEW_OPTIONS, wxOsmo4Frame::OnOptions)
-       EVT_MENU(VIEW_AR_KEEP, wxOsmo4Frame::OnViewARKeep)
-       EVT_MENU(VIEW_AR_FILL, wxOsmo4Frame::OnViewARFill)
-       EVT_MENU(VIEW_AR_169, wxOsmo4Frame::OnViewAR169)
-       EVT_MENU(VIEW_AR_43, wxOsmo4Frame::OnViewAR43)
-       EVT_MENU(VIEW_ORIGINAL, wxOsmo4Frame::OnViewOriginal)
-       EVT_MENU(VIEW_PLAYLIST, wxOsmo4Frame::OnPlaylist)
-       EVT_UPDATE_UI(VIEW_PLAYLIST, wxOsmo4Frame::OnUpdatePlayList)
-       EVT_MENU(FILE_COPY, wxOsmo4Frame::OnFileCopy)
-       EVT_UPDATE_UI(FILE_COPY, wxOsmo4Frame::OnUpdateFileCopy)
-       EVT_MENU(FILE_PASTE, wxOsmo4Frame::OnFilePaste)
-       EVT_UPDATE_UI(FILE_PASTE, wxOsmo4Frame::OnUpdateFilePaste)
-
-       EVT_MENU(ID_CLEAR_NAV, wxOsmo4Frame::OnClearNav)
-       EVT_UPDATE_UI(ID_STREAM_MENU, wxOsmo4Frame::OnUpdateStreamMenu)
-       EVT_UPDATE_UI(ID_CHAPTER_MENU, wxOsmo4Frame::OnUpdateChapterMenu)
-       EVT_MENU(ID_ADD_SUB, wxOsmo4Frame::OnAddSub)
-
-       EVT_MENU(ID_MCACHE_ENABLE, wxOsmo4Frame::OnCacheEnable)
-       EVT_UPDATE_UI(ID_MCACHE_ENABLE, wxOsmo4Frame::OnUpdateCacheEnable)
-       EVT_MENU(ID_MCACHE_STOP, wxOsmo4Frame::OnCacheStop)
-       EVT_MENU(ID_MCACHE_ABORT, wxOsmo4Frame::OnCacheAbort)
-       EVT_UPDATE_UI(ID_MCACHE_STOP, wxOsmo4Frame::OnUpdateCacheAbort)
-       EVT_UPDATE_UI(ID_MCACHE_ABORT, wxOsmo4Frame::OnUpdateCacheAbort)
-
-
-       EVT_MENU(APP_SHORTCUTS, wxOsmo4Frame::OnShortcuts)
-       EVT_MENU(APP_NAV_KEYS, wxOsmo4Frame::OnNavInfo)
-       EVT_MENU(APP_ABOUT, wxOsmo4Frame::OnAbout)
-       EVT_GPACEVENT(wxOsmo4Frame::OnGPACEvent)
-       EVT_TIMER(ID_CTRL_TIMER, wxOsmo4Frame::OnTimer)
-       EVT_COMMAND_SCROLL(ID_SLIDER, wxOsmo4Frame::OnSlide)
-       EVT_MENU(VIEW_LOGS, wxOsmo4Frame::OnLogs)
-       EVT_MENU(VIEW_RTI, wxOsmo4Frame::OnRTI)
-
-       EVT_MENUBUTTON_OPEN(FILE_PREV, wxOsmo4Frame::OnFilePrevOpen)
-       EVT_MENUBUTTON_OPEN(FILE_NEXT, wxOsmo4Frame::OnFileNextOpen)
-    EVT_MENU(FILE_PREV, wxOsmo4Frame::OnNavPrev)
-       EVT_UPDATE_UI(FILE_PREV, wxOsmo4Frame::OnUpdateNavPrev)
-    EVT_MENU_RANGE(ID_NAV_PREV_0, ID_NAV_PREV_9, wxOsmo4Frame::OnNavPrevMenu)
-    EVT_MENU(FILE_NEXT, wxOsmo4Frame::OnNavNext)
-       EVT_UPDATE_UI(FILE_NEXT, wxOsmo4Frame::OnUpdateNavNext)
-    EVT_MENU_RANGE(ID_NAV_NEXT_0, ID_NAV_NEXT_9, wxOsmo4Frame::OnNavNextMenu)
-
-       EVT_TOOL(FILE_PLAY, wxOsmo4Frame::OnFilePlay)
-       EVT_TOOL(FILE_STEP, wxOsmo4Frame::OnFileStep)
-    EVT_TOOL(FILE_STOP, wxOsmo4Frame::OnFileStop)
-    EVT_TOOL(SWITCH_RENDER, wxOsmo4Frame::OnRenderSwitch)
-
-       EVT_COMBOBOX(ID_ADDRESS, wxOsmo4Frame::OnURLSelect)
-
-    EVT_MENU_RANGE(ID_SELSTREAM_0, ID_SELSTREAM_9, wxOsmo4Frame::OnStreamSel)
-       EVT_UPDATE_UI_RANGE(ID_SELSTREAM_0, ID_SELSTREAM_9, wxOsmo4Frame::OnUpdateStreamSel)
-
-    EVT_MENU_RANGE(ID_SETCHAP_FIRST, ID_SETCHAP_LAST, wxOsmo4Frame::OnChapterSel)
-       EVT_UPDATE_UI_RANGE(ID_SETCHAP_FIRST, ID_SETCHAP_LAST, wxOsmo4Frame::OnUpdateChapterSel)
-
-    EVT_MENU_RANGE(ID_VIEWPOINT_FIRST, ID_VIEWPOINT_LAST, wxOsmo4Frame::OnViewport)
-       EVT_UPDATE_UI_RANGE(ID_VIEWPOINT_FIRST, ID_VIEWPOINT_LAST, wxOsmo4Frame::OnUpdateViewport)
-
-    EVT_MENU_RANGE(ID_NAVIGATE_NONE, ID_NAVIGATE_GAME, wxOsmo4Frame::OnNavigate)
-       EVT_UPDATE_UI_RANGE(ID_NAVIGATE_NONE, ID_NAVIGATE_GAME, wxOsmo4Frame::OnUpdateNavigation)
-       EVT_MENU(ID_NAVIGATE_RESET, wxOsmo4Frame::OnNavigateReset)
-
-    EVT_MENU_RANGE(ID_COLLIDE_NONE, ID_COLLIDE_DISP, wxOsmo4Frame::OnCollide)
-       EVT_UPDATE_UI_RANGE(ID_COLLIDE_NONE, ID_COLLIDE_DISP, wxOsmo4Frame::OnUpdateCollide)
-
-       EVT_MENU(ID_HEADLIGHT, wxOsmo4Frame::OnHeadlight)
-       EVT_UPDATE_UI(ID_HEADLIGHT, wxOsmo4Frame::OnUpdateHeadlight)
-       EVT_MENU(ID_GRAVITY, wxOsmo4Frame::OnGravity)
-       EVT_UPDATE_UI(ID_GRAVITY, wxOsmo4Frame::OnUpdateGravity)
-
-       EVT_UPDATE_UI(FILE_PROPERTIES, wxOsmo4Frame::OnUpdateNeedsConnect)
-       EVT_UPDATE_UI(FILE_RELOAD, wxOsmo4Frame::OnUpdateNeedsConnect)
-       EVT_UPDATE_UI(FILE_PLAY, wxOsmo4Frame::OnUpdatePlay)
-       EVT_UPDATE_UI(FILE_STOP, wxOsmo4Frame::OnUpdateNeedsConnect)
-       EVT_UPDATE_UI(FILE_STEP, wxOsmo4Frame::OnUpdateNeedsConnect)
-       EVT_UPDATE_UI(VIEW_ORIGINAL, wxOsmo4Frame::OnUpdateNeedsConnect)
-       EVT_UPDATE_UI(VIEW_FULLSCREEN, wxOsmo4Frame::OnUpdateFullScreen)
-       EVT_UPDATE_UI(VIEW_AR_KEEP, wxOsmo4Frame::OnUpdateAR)
-       EVT_UPDATE_UI(VIEW_AR_FILL, wxOsmo4Frame::OnUpdateAR)
-       EVT_UPDATE_UI(VIEW_AR_169, wxOsmo4Frame::OnUpdateAR)
-       EVT_UPDATE_UI(VIEW_AR_43, wxOsmo4Frame::OnUpdateAR)
-
-       EVT_SIZE(wxOsmo4Frame::OnSize)
-END_EVENT_TABLE()
-
-void wxOsmo4Frame::DoLayout(u32 v_width, u32 v_height)
-{
-       wxPoint pos;
-       if (!m_Address || !m_pProg) return;
-
-       int t_h = m_pToolBar->GetSize().y;
-       int a_h = m_pAddBar->GetSize().y;
-       int p_h = m_pProg->GetSize().y;
-
-       if (m_bExternalView) {
-         if (v_width && v_height) {
-               m_orig_width = v_width;
-               m_orig_height = v_height;
-         }
-         SetClientSize(320, a_h+p_h+t_h);
-         m_pAddBar->SetDimension(0,0, 320, a_h);
-         m_pProg->SetSize(0, t_h+a_h, 320, p_h, 0);
-         return;
-       }
-
-       if (v_width && v_height) {
-               m_orig_width = v_width;
-               m_orig_height = v_height;
-               v_height += a_h + p_h + t_h;
-               SetClientSize(v_width, v_height);
-               m_pView->SetSize(0, a_h+t_h, v_width, v_height, 0);
-               m_pAddBar->SetDimension(0, t_h, v_width, a_h);
-               m_pProg->SetSize(0, v_height - p_h, v_width, p_h, 0);
-       }
-       wxSize s = GetClientSize();
-       s.y -= a_h + p_h + t_h;
-       if (m_pView) {
-               m_pView->SetSize(0, a_h+t_h, s.x, s.y, 0);
-               m_pAddBar->SetDimension(0, 0, s.x, a_h);
-               m_pAddBar->SetDimension(0, 0, s.x, a_h);
-               m_pAddBar->Layout();
-               m_pProg->SetSize(0, s.y+t_h+a_h, s.x, p_h, 0);
-               if (m_term) gf_term_set_size(m_term, s.x, s.y);
-       }
-}
-
-void wxOsmo4Frame::OnSize(wxSizeEvent &event)
-{
-       DoLayout();
-}
-
-void wxOsmo4Frame::OnCloseApp(wxCloseEvent &WXUNUSED(event))
-{
-       if (m_term) gf_term_del(m_term);
-       m_term = NULL;
-       Destroy();
-}
-
-
-wxString wxOsmo4Frame::GetFileFilter()
-{
-       u32 keyCount, i;
-       wxString sFiles, sSupportedFiles, sExts;
-
-       /*force MP4 and 3GP files at beginning to make sure they are selected (Win32 bug with too large filters)*/
-       sSupportedFiles = wxT("All Known Files|*.m3u;*.pls;*.mp4;*.3gp;*.3g2");
-       sExts = wxT("");
-       sFiles = wxT("");
-       keyCount = gf_cfg_get_key_count(m_user.config, "MimeTypes");
-       for (i=0; i<keyCount; i++) {
-               Bool first = 1;
-               const char *sMime;
-               char *sKey;
-               const char *opt;
-               char szKeyList[1000], sDesc[1000];
-               sMime = gf_cfg_get_key_name(m_user.config, "MimeTypes", i);
-               if (!sMime) continue;
-               opt = gf_cfg_get_key(m_user.config, "MimeTypes", sMime);
-               /*remove module name*/
-               strcpy(szKeyList, opt+1);
-               sKey = strrchr(szKeyList, '\"');
-               if (!sKey) continue;
-               sKey[0] = 0;
-               /*get description*/
-               sKey = strrchr(szKeyList, '\"');
-               if (!sKey) continue;
-               strcpy(sDesc, sKey+1);
-               sKey[0] = 0;
-               sKey = strrchr(szKeyList, '\"');
-               if (!sKey) continue;
-               sKey[0] = 0;
-
-               /*if same description for # mime types skip (means an old mime syntax)*/
-               if (sFiles.Find(wxString(sDesc, wxConvUTF8) )>=0) continue;
-               /*if same extensions for # mime types skip (don't polluate the file list)*/
-               if (sExts.Find(wxString(szKeyList, wxConvUTF8) )>=0) continue;
-
-               sExts += wxString(szKeyList, wxConvUTF8);
-               sExts += wxT(" ");
-               sFiles += wxString(sDesc, wxConvUTF8);
-               sFiles += wxT("|");
-
-               wxString sOpt = wxString(szKeyList, wxConvUTF8);
-               while (1) {
-                       wxString ext = sOpt.BeforeFirst(' ');
-                       if (ext.Find('.')<0) {
-                               if (first) first = 0;
-                               else sFiles += wxT(";");
-                               sFiles += wxT("*.");
-                               sFiles += ext;
-                               wxString sext = ext;
-                               sext += wxT(";");
-                               if (sSupportedFiles.Find(sext)<0) {
-                                       sSupportedFiles  += wxT(";*.");
-                                       sSupportedFiles += ext;
-                               }
-                       }
-                       if (sOpt==ext) break;
-                       wxString rem = ext + wxT(" ");
-                       sOpt.Replace(rem, wxT(""), TRUE);
-               }
-               sFiles += wxT("|");
-       }
-       sSupportedFiles += wxT("|");
-       sSupportedFiles += sFiles;
-       sSupportedFiles += wxT("M3U Playlists|*.m3u|ShoutCast Playlists|*.pls|All Files|*.*||");
-       return sSupportedFiles;
-}
-
-void wxOsmo4Frame::OnFileOpen(wxCommandEvent & WXUNUSED(event))
-{
-       wxFileDialog dlg(this, wxT("Select file(s)"), wxT(""), wxT(""), GetFileFilter(), wxOPEN | wxMULTIPLE | wxCHANGE_DIR /*| wxHIDE_READONLY*/);
-
-       if (dlg.ShowModal() != wxID_OK) return;
-
-       wxArrayString stra;
-       dlg.GetPaths(stra);
-       if (stra.GetCount() == 1) {
-               m_pPlayList->Truncate();
-       } else {
-               m_pPlayList->Clear();
-       }
-       for (u32 i=0; i<stra.GetCount(); i++)
-               m_pPlayList->QueueURL(stra[i]);
-
-       m_pPlayList->RefreshList();
-       m_pPlayList->PlayNext();
-}
-
-void wxOsmo4Frame::OnFileOpenURL(wxCommandEvent & WXUNUSED(event))
-{
-       OpenURLDlg dlg(this, m_user.config);
-       if (dlg.ShowModal()==wxID_OK) {
-               m_pPlayList->Truncate();
-               m_pPlayList->QueueURL(dlg.m_urlVal);
-               m_pPlayList->RefreshList();
-               m_pPlayList->PlayNext();
-       }
-}
-
-void wxOsmo4Frame::OnFileProperties(wxCommandEvent & WXUNUSED(event))
-{
-       wxFileProps dlg(this);
-       dlg.SetIcon(wxIcon(osmo4));
-       dlg.ShowModal();
-}
-
-void wxOsmo4Frame::OnFileReload(wxCommandEvent & WXUNUSED(event))
-{
-       gf_term_disconnect(m_term);
-       m_connected = 0;
-       DoConnect();
-}
-
-void wxOsmo4Frame::OnFileReloadConfig(wxCommandEvent & WXUNUSED(event))
-{
-       gf_term_set_option(m_term, GF_OPT_RELOAD_CONFIG, 1);
-}
-
-void wxOsmo4Frame::OnFileQuit(wxCommandEvent & WXUNUSED(event))
-{
-       Close(FALSE);
-}
-
-void wxOsmo4Frame::OnViewOriginal(wxCommandEvent & WXUNUSED(event))
-{
-       if (!m_bExternalView) {
-               DoLayout(m_orig_width, m_orig_height);
-       } else {
-               gf_term_set_option(m_term, GF_OPT_ORIGINAL_VIEW, 1);
-       }
-}
-
-void wxOsmo4Frame::OnOptions(wxCommandEvent & WXUNUSED(event))
-{
-       wxGPACControl dlg(this);
-       dlg.SetIcon(wxIcon(osmo4));
-       dlg.ShowModal();
-}
-
-void wxOsmo4Frame::DoConnect()
-{
-       //if (m_connected) { gf_term_disconnect(m_term); m_connected = 0; }
-
-       wxString url = m_pPlayList->GetURL();
-       m_Address->SetValue(url);
-#ifdef __WXGTK__
-       m_pVisual->SetFocus();
-#else
-       m_pView->SetFocus();
-#endif
-       wxString txt = wxT("Osmo4 - ");
-       txt += m_pPlayList->GetDisplayName();
-       SetTitle(txt);
-       m_bStartupFile = 0;
-       gf_term_connect(m_term, url.mb_str(wxConvUTF8));
-}
-
-void wxOsmo4Frame::OnLogs(wxCommandEvent & WXUNUSED(event))
-{
-       m_pLogs->Show();
-}
-
-void wxOsmo4Frame::OnUpdateNeedsConnect(wxUpdateUIEvent &event)
-{
-       event.Enable(m_connected ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnUpdatePlay(wxUpdateUIEvent &event)
-{
-       event.Enable( (m_connected || m_pPlayList->HasValidEntries()) ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnUpdateFullScreen(wxUpdateUIEvent &event)
-{
-       if (m_connected) {
-               event.Enable(1);
-               event.Check(gf_term_get_option(m_term, GF_OPT_FULLSCREEN) ? 1 : 0);
-       } else {
-               event.Enable(0);
-       }
-}
-
-void wxOsmo4Frame::OnFullScreen(wxCommandEvent & WXUNUSED(event))
-{
-       Bool isFS = gf_term_get_option(m_term, GF_OPT_FULLSCREEN) ? 1 : 0;
-       gf_term_set_option(m_term, GF_OPT_FULLSCREEN, isFS ? 0 : 1);
-}
-
-void wxOsmo4Frame::OnViewARKeep(wxCommandEvent & WXUNUSED(event))
-{
-       gf_term_set_option(m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);
-}
-void wxOsmo4Frame::OnViewARFill(wxCommandEvent & WXUNUSED(event))
-{
-       gf_term_set_option(m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN);
-}
-void wxOsmo4Frame::OnViewAR169(wxCommandEvent & WXUNUSED(event))
-{
-       gf_term_set_option(m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9);
-}
-void wxOsmo4Frame::OnViewAR43(wxCommandEvent & WXUNUSED(event))
-{
-       gf_term_set_option(m_term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3);
-}
-
-void wxOsmo4Frame::OnUpdateAR(wxUpdateUIEvent &event)
-{
-       if (!m_connected) {
-               event.Enable(0);
-               return;
-       }
-       event.Enable(1);
-       u32 val = gf_term_get_option(m_term, GF_OPT_ASPECT_RATIO);
-       if ((event.GetId() == VIEW_AR_FILL) && (val==GF_ASPECT_RATIO_FILL_SCREEN))
-               event.Check(1);
-       else if ((event.GetId() == VIEW_AR_KEEP) && (val==GF_ASPECT_RATIO_KEEP))
-               event.Check(1);
-       else if ((event.GetId() == VIEW_AR_169) && (val==GF_ASPECT_RATIO_16_9))
-               event.Check(1);
-       else if ((event.GetId() == VIEW_AR_43) && (val==GF_ASPECT_RATIO_4_3))
-               event.Check(1);
-       else event.Check(0);
-}
-
-void wxOsmo4Frame::OnShortcuts(wxCommandEvent & WXUNUSED(event))
-{
-       wxMessageDialog dlg(this,
-               wxT("Shortcuts with focus on main frame:\n")
-               wxT("Open File: Ctrl + O\n")
-               wxT("Show File Information: Ctrl + I\n")
-               wxT("Reload File: Ctrl + R\n")
-               wxT("Pause/Resume File: Ctrl + P\n")
-               wxT("Step by Step: Ctrl + S\n")
-               wxT("Fullscreen On/Off: Alt + Return\n")
-               wxT("View Playlist: Ctrl + L\n")
-               wxT("Aspect Ratio Normal: Ctrl + 1\n")
-               wxT("Aspect Ratio Fill: Ctrl + 2\n")
-               wxT("Aspect Ratio 4/3: Ctrl + 3\n")
-               wxT("Aspect Ratio 16/9: Ctrl + 4\n")
-               wxT("\n")
-               wxT("Shortcuts with focus on video frame:\n")
-               wxT("Seek +5% into presentation: Alt + right arrow\n")
-               wxT("Seek -5% into presentation: Alt + left arrow\n")
-               wxT("Seek +1min into presentation: Alt + up arrow\n")
-               wxT("Seek -1min into presentation: Alt + down arrow\n")
-               wxT("Next Playlist Entry: Ctrl + right arrow\n")
-               wxT("Prev Playlist Entry: Ctrl + left arrow\n")
-
-               , wxT("Shortcuts Available on Osmo4")
-               , wxOK);
-
-       dlg.ShowModal();
-}
-
-void wxOsmo4Frame::OnNavInfo(wxCommandEvent & WXUNUSED(event))
-{
-       wxMessageDialog dlg(this,
-               wxT("* Walk & Fly modes:\n")
-               wxT("\tH move: H pan - V move: Z-translate - V move+CTRL or Wheel: V pan - Right Click (Walk only): Jump\n")
-               wxT("\tleft/right: H pan - left/right+CTRL: H translate - up/down: Z-translate - up/down+CTRL: V pan\n")
-               wxT("* Pan mode:\n")
-               wxT("\tH move: H pan - V move: V pan - V move+CTRL or Wheel: Z-translate\n")
-               wxT("\tleft/right: H pan - left/right+CTRL: H translate - up/down: V pan - up/down+CTRL: Z-translate\n")
-               wxT("* Slide mode:\n")
-               wxT("\tH move: H translate - V move: V translate - V move+CTRL or Wheel: Z-translate\n")
-               wxT("\tleft/right: H translate - left/right+CTRL: H pan - up/down: V translate - up/down+CTRL: Z-translate\n")
-               wxT("* Examine & Orbit mode:\n")
-               wxT("\tH move: Y-Axis rotate - H move+CTRL: No move - V move: X-Axis rotate - V move+CTRL or Wheel: Z-translate\n")
-               wxT("\tleft/right: Y-Axis rotate - left/right+CTRL: H translate - up/down: X-Axis rotate - up/down+CTRL: Y-translate\n")
-               wxT("* VR mode:\n")
-               wxT("\tH move: H pan - V move: V pan - V move+CTRL or Wheel: Camera Zoom\n")
-               wxT("\tleft/right: H pan - up/down: V pan - up/down+CTRL: Camera Zoom\n")
-               wxT("* Game mode (press END to escape):\n")
-               wxT("\tH move: H pan - V move: V pan\n")
-               wxT("\tleft/right: H translate - up/down: Z-translate\n")
-               wxT("\n")
-               wxT("* All 3D modes: CTRL+PGUP/PGDOWN will zoom in/out camera (field of view) \n")
-               wxT("\n")
-               wxT("*Slide Mode in 2D:\n")
-               wxT("\tH move: H translate - V move: V translate - V move+CTRL: zoom\n")
-               wxT("\tleft/right: H translate - up/down: V translate - up/down+CTRL: zoom\n")
-               wxT("*Examine Mode in 2D (3D renderer only):\n")
-               wxT("\tH move: Y-Axis rotate - V move: X-Axis rotate\n")
-               wxT("\tleft/right: Y-Axis rotate - up/down: X-Axis rotate\n")
-               wxT("\n")
-               wxT("HOME: reset navigation to last viewpoint (2D or 3D navigation)\n")
-               wxT("SHIFT key in all modes: fast movement\n")
-
-               , wxT("3D navigation keys (\'H\'orizontal and \'V\'ertical) used in GPAC")
-               , wxOK );
-       dlg.ShowModal();
-}
-
-
-/*open file dlg*/
-class AboutDlg : public wxDialog {
-public:
-    AboutDlg(wxWindow *parent);
-
-private:
-    wxStaticText *m_info;
-    wxButton *m_close;
-       void OnClose(wxCommandEvent& event);
-    DECLARE_EVENT_TABLE()
-};
-
-BEGIN_EVENT_TABLE(AboutDlg, wxDialog)
-    EVT_BUTTON(ID_ABOUT_CLOSE, AboutDlg::OnClose)
-END_EVENT_TABLE()
-
-AboutDlg::AboutDlg(wxWindow *parent)
-             : wxDialog(parent, -1, wxString(wxT("GPAC/Osmo4 V ")wxT(GPAC_FULL_VERSION)))
-{
-       SetSize(220, 320);
-       Centre();
-       wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
-
-       m_info = new wxStaticText(this, -1, wxT("http://gpac.sourceforge.net"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
-       sizer->Add(m_info, 1, wxEXPAND|wxADJUST_MINSIZE, 0);
-    m_close = new wxButton(this, ID_ABOUT_CLOSE, wxT("Close"), wxDefaultPosition, wxSize(120, 20));
-       sizer->Add(m_close, 0, wxEXPAND, 0);
-
-       SetIcon(wxIcon(osmo4));
-       m_info->SetLabel(
-               wxT("Osmo4 Player\n")
-               wxT("GPAC Multimedia Framework\n")
-               wxT("\n")
-               wxT("This program is gf_free software and may\n")
-               wxT("be distributed according to the terms\n")
-               wxT("of the GNU Lesser General Public License\n")
-               wxT("\n")
-               wxT("Copyright (c) Jean Le Feuvre 2000-2005\n")
-               wxT("(c) ENST 2005-200X\n")
-               wxT("All Rights Reserved\n")
-               wxT("http://gpac.sourceforge.net\n")
-               wxT("\n")
-               wxT(" ** With Many Thanks To ** \n\n")
-               wxT("Mozilla SpiderMonkey (JavaScript)\n")
-               wxT("The FreeType Project\n")
-               wxT("The PNG Group, The I.J.G.\n")
-               wxT("FFMPEG, FAAD, XVID, MAD\n")
-               );
-
-       SetSizer(sizer);
-       sizer->Fit(this);
-}
-void AboutDlg::OnClose(wxCommandEvent& WXUNUSED(event))
-{
-       Close(FALSE);
-}
-
-void wxOsmo4Frame::OnAbout(wxCommandEvent & WXUNUSED(event))
-{
-       AboutDlg dlg(this);
-       dlg.ShowModal();
-}
-
-
-void wxOsmo4Frame::OnGPACEvent(wxGPACEvent &event)
-{
-       wxString cmd;
-       wxCommandEvent evt;
-       if (!m_term) return;
-
-       switch (event.gpac_evt.type) {
-       case GF_EVENT_NAVIGATE:
-               if (gf_term_is_supported_url(m_term, event.to_url.mb_str(wxConvUTF8), 1, 0)) {
-                       char *str = gf_url_concatenate(m_pPlayList->GetURL().mb_str(wxConvUTF8), event.to_url.mb_str(wxConvUTF8));
-                       if (str) {
-                               m_pPlayList->Truncate();
-                               m_pPlayList->QueueURL(wxString(str, wxConvUTF8));
-                               m_pPlayList->RefreshList();
-                               gf_free(str);
-                               m_pPlayList->PlayNext();
-                       }
-                       return;
-               }
-               cmd = get_pref_browser(m_user.config);
-               if (cmd.IsEmpty()){
-                 cmd += wxT(" ");
-                 cmd += event.to_url;
-                 wxExecute(cmd);
-               } else {
-#ifdef wxLaunchDefaultBrowser
-                       wxLaunchDefaultBrowser(event.to_url);
-#endif
-               }
-               break;
-       case GF_EVENT_QUIT:
-               Close(TRUE);
-               break;
-       case GF_EVENT_SET_CAPTION:
-               SetTitle(event.to_url);
-               break;
-       case GF_EVENT_CONNECT:
-               BuildStreamList(0);
-               ConnectAcknowledged(event.gpac_evt.connect.is_connected);
-               break;
-       case GF_EVENT_KEYDOWN:
-               if (!(event.gpac_evt.key.flags & GF_KEY_MOD_CTRL)) return;
-               switch (event.gpac_evt.key.key_code) {
-               case GF_KEY_R:
-                       gf_term_set_option(m_term, GF_OPT_REFRESH, 1);
-                       break;
-               case GF_KEY_P:
-                       OnFilePlay(evt);
-                       break;
-               case GF_KEY_S:
-                       OnFileStep(evt);
-                       break;
-               }
-               break;
-       case GF_EVENT_SCENE_SIZE:
-               m_orig_width = event.gpac_evt.size.width;
-               m_orig_height = event.gpac_evt.size.height;
-       case GF_EVENT_SIZE:
-               if (! gf_term_get_option(m_term, GF_OPT_FULLSCREEN)) {
-                       DoLayout(event.gpac_evt.size.width, event.gpac_evt.size.height);
-               }
-               break;
-       case GF_EVENT_VIEWPOINTS:
-               BuildViewList();
-               break;
-       case GF_EVENT_STREAMLIST:
-               BuildStreamList(0);
-               break;
-       }
-}
-
-
-static wxString format_time(u32 duration, u32 timescale)
-{
-       u32 h, m, s;
-       Float time = duration;
-       time /= timescale;
-       time *= 1000;
-       h = (u32) (time / 1000 / 3600);
-       m = (u32) (time / 1000 / 60 - h*60);
-       s = (u32) (time / 1000 - h*3600 - m*60);
-       return wxString::Format(wxT("%02d:%02d:%02d"), h, m, s);
-}
-
-void wxOsmo4Frame::SetStatus(wxString str)
-{
-       //m_pStatusbar->SetStatusText(str, 2);
-       m_LastStatusTime = gf_sys_clock();
-}
-
-#define RTI_REFRESH_MS         500
-void wxOsmo4Frame::OnRTI(wxCommandEvent & event)
-{
-       m_bViewRTI = event.IsChecked();
-       if (m_bViewRTI) {
-               if (!m_pTimer->IsRunning()) m_pTimer->Start(RTI_REFRESH_MS, 0);
-       } else if (!m_connected && m_pTimer->IsRunning()) {
-               m_LastStatusTime = 0;
-               m_pStatusbar->SetStatusText(wxT("Ready"), 2);
-               m_pTimer->Stop();
-       }
-}
-
-void wxOsmo4Frame::OnTimer(wxTimerEvent& WXUNUSED(event))
-{
-       wxString str;
-       u32 now;
-       if (m_LastStatusTime) {
-               now = gf_sys_clock();
-               if (now > 1000+m_LastStatusTime) {
-                       m_LastStatusTime = 0;
-                       m_pStatusbar->SetStatusText(wxT("Ready"), 2);
-               }
-       }
-
-       if (m_bViewRTI) {
-               GF_SystemRTInfo rti;
-               if (!gf_sys_get_rti(RTI_REFRESH_MS, &rti, 0)) return;
-               if (rti.gpac_memory) rti.process_memory = rti.gpac_memory;
-
-               str = wxString::Format(wxT("CPU %02d (%02d) - Mem %d kB" ),
-                                               rti.total_cpu_usage, rti.process_cpu_usage, rti.gpac_memory/1024);
-
-               m_pStatusbar->SetStatusText(str, 2);
-       }
-       if (!m_connected) return;
-
-       now = gf_term_get_time_in_ms(m_term);
-       if (!now) return;
-
-       if (!m_duration) {
-               str = format_time(now, 1000);
-               m_pStatusbar->SetStatusText(str);
-               str = wxString::Format(wxT("FPS %.2f"), gf_term_get_framerate(m_term, 0));
-               m_pStatusbar->SetStatusText(str, 1);
-               return;
-       }
-#ifdef __WXGTK__
-       if (m_bGrabbed) {
-         u32 now = gf_sys_clock() - m_last_grab_time;
-         if (now>200) {
-           m_bGrabbed = 0;
-           Double res = (Double) m_last_grab_pos;
-           res /= 1000;
-           res *= m_duration;
-           if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED) {
-                       gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
-                       m_bToReset = 0;
-           }
-           gf_term_play_from_time(m_term, (u32) res, 0);
-           return;
-         }
-       }
-#endif
-
-       if (!m_bGrabbed) {
-               if ((now >= m_duration + 500) && gf_term_get_option(m_term, GF_OPT_IS_FINISHED)) {
-                       m_pPlayList->PlayNext();
-               } else {
-                       Double val = now * 1000;
-                       val /= m_duration;
-                       m_pProg->SetValue((val<=1000) ? (u32) val : 1000);
-
-                       if (0) {
-                               str = format_time(m_duration-now, 1000);
-                       } else {
-                               str = format_time(now, 1000);
-                       }
-                       m_pStatusbar->SetStatusText(str);
-                       str = wxString::Format(wxT("FPS %.2f"), gf_term_get_framerate(m_term, 0));
-                       m_pStatusbar->SetStatusText(str, 1);
-               }
-       }
-}
-
-void wxOsmo4Frame::ConnectAcknowledged(Bool bOk)
-{
-       if (bOk) {
-               m_pTimer->Start(RTI_REFRESH_MS, 0);
-               m_connected = 1;
-               m_bToReset = 0;
-               UpdatePlay();
-               BuildChapterList(0);
-       } else {
-               BuildChapterList(1);
-               if (!m_connected) {
-                       UpdatePlay();
-                       m_pTimer->Stop();
-                       //m_pProg->Enable(0);
-               }
-       }
-}
-
-void wxOsmo4Frame::OnFilePlay(wxCommandEvent & WXUNUSED(event))
-{
-       wxCommandEvent evt;
-       if (m_connected) {
-               if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED) {
-                       gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
-                       if (m_bToReset) {
-                               m_pTimer->Start(100, 0);
-                               gf_term_play_from_time(m_term, 0, 0);
-                       }
-                       m_bToReset = 0;
-                       UpdatePlay();
-               } else {
-                       gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
-                       UpdatePlay();
-               }
-       } else {
-               m_pPlayList->Play();
-       }
-}
-
-void wxOsmo4Frame::OnFileStep(wxCommandEvent & WXUNUSED(event))
-{
-       wxCommandEvent evt;
-       gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_STEP_PAUSE);
-       UpdatePlay();
-}
-
-void wxOsmo4Frame::OnFileStop(wxCommandEvent &WXUNUSED(event))
-{
-       Stop();
-}
-
-void wxOsmo4Frame::Stop()
-{
-       if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
-               gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
-       }
-       m_bToReset = 1;
-       m_pTimer->Stop();
-       m_pProg->SetValue(0);
-       UpdatePlay();
-}
-
-void wxOsmo4Frame::OnSlide(wxScrollEvent &event)
-{
-       if (!m_duration) return;
-
-       /*wxSlider on GTK is buggy, so track a release timeout*/
-#ifdef __WXGTK__
-       m_last_grab_time = gf_sys_clock();
-       m_bGrabbed = 1;
-       m_last_grab_pos = event.GetPosition();
-       Double now = (Double) m_last_grab_pos;
-       now /= 1000;
-       now *= m_duration;
-       wxString str = format_time((u32) (now), 1000);
-       m_pStatusbar->SetStatusText(str);
-       if (!m_pTimer->IsRunning()) m_pTimer->Start(100, 0);
-#else
-       s32 type = event.GetEventType();
-       if (type == wxEVT_SCROLL_THUMBTRACK) {
-         m_bGrabbed = 1;
-         Double now = (Double) event.GetPosition();
-         now /= 1000;
-         now *= m_duration;
-         wxString str = format_time((u32) (now), 1000);
-         m_pStatusbar->SetStatusText(str);
-       }
-       else if (m_bGrabbed){
-           m_bGrabbed = 0;
-           Double res = (Double) m_pProg->GetValue();
-           res /= 1000;
-           res *= m_duration;
-           if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED) {
-                       gf_term_set_option(m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
-                       m_bToReset = 0;
-                       if (!m_pTimer->IsRunning()) m_pTimer->Start(100, 0);
-           }
-           gf_term_play_from_time(m_term, (u32) res, 0);
-       }
-#endif
-}
-
-
-void wxOsmo4Frame::BuildViewList()
-{
-       if (!vp_list || !m_connected) return;
-
-       while (vp_list->GetMenuItemCount()) {
-               wxMenuItem* it = vp_list->FindItemByPosition(0);
-               vp_list->Delete(it);
-       }
-
-       s32 id = ID_VIEWPOINT_FIRST;
-       nb_viewpoints = 0;
-       while (1) {
-               const char *szName;
-               Bool bound;
-               GF_Err e = gf_term_get_viewpoint(m_term, nb_viewpoints+1, &szName, &bound);
-               if (e) break;
-               if (szName) {
-                       vp_list->AppendCheckItem(id+nb_viewpoints, wxString(szName, wxConvUTF8) );
-               } else {
-                       vp_list->AppendCheckItem(id+nb_viewpoints, wxString::Format(wxT("Viewpoint #%d"), nb_viewpoints+1) );
-               }
-               nb_viewpoints++;
-       }
-}
-
-void wxOsmo4Frame::OnViewport(wxCommandEvent & event)
-{
-       u32 ID = event.GetId() - ID_VIEWPOINT_FIRST;
-       gf_term_set_viewpoint(m_term, ID+1, NULL);
-}
-
-void wxOsmo4Frame::OnUpdateViewport(wxUpdateUIEvent & event)
-{
-       u32 ID = event.GetId() - ID_VIEWPOINT_FIRST;
-       const char *szName;
-       Bool bound;
-       gf_term_get_viewpoint(m_term, ID+1, &szName, &bound);
-       event.Enable(1);
-       if (bound) event.Check(1);
-}
-
-void wxOsmo4Frame::OnNavigate(wxCommandEvent & event)
-{
-       switch (event.GetId()) {
-       case ID_NAVIGATE_NONE: gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_NONE); break;
-       case ID_NAVIGATE_WALK: gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_WALK); break;
-       case ID_NAVIGATE_FLY: gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_FLY); break;
-       case ID_NAVIGATE_EXAMINE: gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_EXAMINE); break;
-       case ID_NAVIGATE_PAN: gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_PAN); break;
-       case ID_NAVIGATE_SLIDE: gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_SLIDE); break;
-       case ID_NAVIGATE_ORBIT: gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_ORBIT); break;
-       case ID_NAVIGATE_GAME: gf_term_set_option(m_term, GF_OPT_NAVIGATION, GF_NAVIGATE_GAME); break;
-       }
-}
-void wxOsmo4Frame::OnNavigateReset(wxCommandEvent & WXUNUSED(event))
-{
-       gf_term_set_option(m_term, GF_OPT_NAVIGATION_TYPE, 0);
-}
-void wxOsmo4Frame::OnUpdateNavigation(wxUpdateUIEvent & event)
-{
-       u32 ID = event.GetId();
-       event.Enable(0);
-       if (!m_connected) return;
-       u32 type = gf_term_get_option(m_term, GF_OPT_NAVIGATION_TYPE);
-       bool enable = type ? 1 : 0;
-
-       u32 mode = gf_term_get_option(m_term, GF_OPT_NAVIGATION);
-       /*common 2D/3D modes*/
-       if (ID==ID_NAVIGATE_NONE) { event.Enable(enable); event.Check(mode ? 0 : 1); }
-       else if (ID==ID_NAVIGATE_EXAMINE) { event.Enable(enable); event.Check((mode==GF_NAVIGATE_EXAMINE) ? 1 : 0); }
-       else if (ID==ID_NAVIGATE_SLIDE) { event.Enable(enable); event.Check((mode==GF_NAVIGATE_SLIDE) ? 1 : 0); }
-
-       if (type==GF_NAVIGATE_TYPE_2D) return;
-       event.Enable(enable);
-       if (ID==ID_NAVIGATE_WALK) event.Check((mode==GF_NAVIGATE_WALK) ? 1 : 0);
-       else if (ID==ID_NAVIGATE_FLY) event.Check((mode==GF_NAVIGATE_FLY) ? 1 : 0);
-       else if (ID==ID_NAVIGATE_PAN) event.Check((mode==GF_NAVIGATE_PAN) ? 1 : 0);
-       else if (ID==ID_NAVIGATE_ORBIT) event.Check((mode==GF_NAVIGATE_ORBIT) ? 1 : 0);
-       else if (ID==ID_NAVIGATE_GAME) event.Check((mode==GF_NAVIGATE_GAME) ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnRenderSwitch(wxCommandEvent &WXUNUSED(event))
-{
-       const char *opt = gf_cfg_get_key(m_user.config, "Compositor", "ForceOpenGL");
-       Bool use_gl = (opt && !stricmp(opt, "yes")) ? 1 : 0;
-       gf_cfg_set_key(m_user.config, "Compositor", "ForceOpenGL", use_gl ? "no" : "yes");
-
-       gf_term_set_option(m_term, GF_OPT_USE_OPENGL, !use_gl);
-
-       UpdateRenderSwitch();
-}
-
-void wxOsmo4Frame::UpdateRenderSwitch()
-{
-       const char *opt = gf_cfg_get_key(m_user.config, "Compositor", "ForceOpenGL");
-       m_pToolBar->RemoveTool(SWITCH_RENDER);
-       if (opt && !stricmp(opt, "yes"))
-               m_pToolBar->InsertTool(12, SWITCH_RENDER, *m_pSW2D, wxNullBitmap, FALSE, NULL, wxT("2D Rasterizer"));
-       else
-               m_pToolBar->InsertTool(12, SWITCH_RENDER, *m_pSW3D, wxNullBitmap, FALSE, NULL, wxT("OpenGL Rendering"));
-
-#ifdef WIN32
-       /*there's a display bug with the menubtn, remove and reinsert*/
-       m_pToolBar->RemoveTool(FILE_PREV);
-       m_pToolBar->RemoveTool(FILE_NEXT);
-       m_pToolBar->InsertControl(2, m_pPrevBut);
-       m_pToolBar->InsertControl(3, m_pNextBut);
-#endif
-       m_pToolBar->Realize();
-}
-
-void wxOsmo4Frame::UpdatePlay()
-{
-       m_pToolBar->RemoveTool(FILE_PLAY);
-       if (m_connected) {
-               if (gf_term_get_option(m_term, GF_OPT_PLAY_STATE)==GF_STATE_PAUSED)
-                       m_pToolBar->InsertTool(5, FILE_PLAY, *m_pPlay, wxNullBitmap, FALSE, NULL, wxT("Pause File"));
-               else
-                       m_pToolBar->InsertTool(5, FILE_PLAY, *m_pPause, wxNullBitmap, FALSE, NULL, wxT("Play File"));
-       } else {
-               m_pToolBar->InsertTool(5, FILE_PLAY, *m_pPlay, wxNullBitmap, FALSE, NULL, wxT("Pause File"));
-       }
-
-#ifdef WIN32
-       /*there's a display bug with the menubtn, remove and reinsert*/
-       m_pToolBar->RemoveTool(FILE_PREV);
-       m_pToolBar->RemoveTool(FILE_NEXT);
-       m_pToolBar->InsertControl(2, m_pPrevBut);
-       m_pToolBar->InsertControl(3, m_pNextBut);
-#endif
-       m_pToolBar->Realize();
-}
-
-void wxOsmo4Frame::OnCollide(wxCommandEvent & event)
-{
-       u32 ID = event.GetId();
-       if (ID==ID_COLLIDE_NONE) gf_term_set_option(m_term, GF_OPT_COLLISION, GF_COLLISION_NONE);
-       else if (ID==ID_COLLIDE_REG) gf_term_set_option(m_term, GF_OPT_COLLISION, GF_COLLISION_NORMAL);
-       else if (ID==ID_COLLIDE_DISP) gf_term_set_option(m_term, GF_OPT_COLLISION, GF_COLLISION_DISPLACEMENT);
-}
-void wxOsmo4Frame::OnUpdateCollide(wxUpdateUIEvent & event)
-{
-       u32 ID = event.GetId();
-       event.Enable(0);
-       if (!m_connected) return;
-       event.Enable(1);
-       u32 mode = gf_term_get_option(m_term, GF_OPT_COLLISION);
-       if (ID==ID_COLLIDE_NONE) { event.Check((mode==GF_COLLISION_NONE) ? 1 : 0); }
-       else if (ID==ID_COLLIDE_REG) { event.Check((mode==GF_COLLISION_NORMAL) ? 1 : 0); }
-       else if (ID==ID_COLLIDE_DISP) { event.Check((mode==GF_COLLISION_DISPLACEMENT) ? 1 : 0); }
-}
-
-void wxOsmo4Frame::OnHeadlight(wxCommandEvent &WXUNUSED(event))
-{
-       Bool val = !gf_term_get_option(m_term, GF_OPT_HEADLIGHT);
-       gf_term_set_option(m_term, GF_OPT_HEADLIGHT, val);
-}
-void wxOsmo4Frame::OnUpdateHeadlight(wxUpdateUIEvent & event)
-{
-       event.Enable(0);
-       if (!m_connected) return;
-       u32 type = gf_term_get_option(m_term, GF_OPT_NAVIGATION_TYPE);
-       if (type!=GF_NAVIGATE_TYPE_3D) return;
-
-       event.Enable(1);
-       event.Check(gf_term_get_option(m_term, GF_OPT_HEADLIGHT) ? 1 : 0);
-}
-void wxOsmo4Frame::OnGravity(wxCommandEvent & WXUNUSED(event))
-{
-       Bool val = gf_term_get_option(m_term, GF_OPT_GRAVITY) ? 0 : 1;
-       gf_term_set_option(m_term, GF_OPT_GRAVITY, val);
-}
-void wxOsmo4Frame::OnUpdateGravity(wxUpdateUIEvent & event)
-{
-       event.Enable(0);
-       if (!m_connected) return;
-       u32 type = gf_term_get_option(m_term, GF_OPT_NAVIGATION_TYPE);
-       if (type!=GF_NAVIGATE_TYPE_3D) return;
-       type = gf_term_get_option(m_term, GF_OPT_NAVIGATION);
-       if (type != GF_NAVIGATE_WALK) return;
-       event.Enable(1);
-       event.Check(gf_term_get_option(m_term, GF_OPT_GRAVITY) ? 1 : 0);
-}
-
-
-BEGIN_EVENT_TABLE(wxMyComboBox, wxComboBox)
-       EVT_KEY_UP(wxMyComboBox::OnKeyUp)
-END_EVENT_TABLE()
-
-void wxMyComboBox::OnKeyUp(wxKeyEvent &event)
-{
-       if (event.GetKeyCode()==WXK_RETURN) {
-               event.Skip();
-               wxCommandEvent evt;
-               evt.SetEventType(wxEVT_COMMAND_COMBOBOX_SELECTED);
-               evt.SetEventObject(this);
-               evt.SetId(GetId());
-               GetParent()->AddPendingEvent(evt);
-       }
-}
-
-
-void wxOsmo4Frame::ReloadURLs()
-{
-       const char *sOpt;
-       u32 i=0;
-
-       m_Address->Clear();
-       while (1) {
-               sOpt = gf_cfg_get_key_name(m_user.config, "RecentFiles", i);
-               if (!sOpt) break;
-               m_Address->Append(wxString(sOpt, wxConvUTF8) );
-               i++;
-       }
-}
-
-void wxOsmo4Frame::SelectionReady()
-{
-       wxString urlVal = m_Address->GetValue();
-       if (urlVal.Find(wxT("://"))>0) {
-               UpdateLastFiles(m_user.config, urlVal.mb_str(wxConvUTF8));
-               ReloadURLs();
-       }
-       m_pPlayList->Truncate();
-       m_pPlayList->QueueURL(urlVal);
-       m_pPlayList->RefreshList();
-       m_pPlayList->PlayNext();
-}
-
-void wxOsmo4Frame::OnURLSelect(wxCommandEvent &WXUNUSED(event))
-{
-       SelectionReady();
-}
-
-void wxOsmo4Frame::OnPlaylist(wxCommandEvent &WXUNUSED(event))
-{
-       assert(m_pPlayList);
-       m_pPlayList->Show(m_pPlayList->IsShown() ? 0 : 1);
-}
-
-void wxOsmo4Frame::OnUpdatePlayList(wxUpdateUIEvent & event)
-{
-       event.Enable(1);
-       event.Check(m_pPlayList->IsShown() ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnFilePrevOpen(wxNotifyEvent & event)
-{
-       u32 count = gf_list_count(m_pPlayList->m_entries);
-       u32 start = m_pPlayList->m_cur_entry - 1;
-       wxMenu *popup = new wxMenu();
-
-       for (u32 i=0; i<10; i++) {
-               if (i > start) break;
-               if (start - i >= count) break;
-               PLEntry *ple = (PLEntry *) gf_list_get(m_pPlayList->m_entries, start - i);
-               popup->Append(ID_NAV_PREV_0 + i, wxString(ple->m_disp_name, wxConvUTF8) );
-       }
-       m_pPrevBut->AssignMenu(popup);
-}
-
-void wxOsmo4Frame::OnFileNextOpen(wxNotifyEvent & event)
-{
-       u32 count = gf_list_count(m_pPlayList->m_entries);
-       wxMenu *popup = new wxMenu();
-       u32 start = m_pPlayList->m_cur_entry + 1;
-       for (u32 i=0; i<10; i++) {
-               if (start + i >= count) break;
-               PLEntry *ple = (PLEntry *) gf_list_get(m_pPlayList->m_entries, start + i);
-               popup->Append(ID_NAV_NEXT_0 + i, wxString(ple->m_disp_name, wxConvUTF8) );
-       }
-       m_pNextBut->AssignMenu(popup);
-}
-
-void wxOsmo4Frame::OnNavPrev(wxCommandEvent &WXUNUSED(event))
-{
-       if (m_pPlayList->m_cur_entry<=0) return;
-       m_pPlayList->PlayPrev();
-}
-void wxOsmo4Frame::OnUpdateNavPrev(wxUpdateUIEvent & event)
-{
-       if (m_pPlayList->m_cur_entry<=0) event.Enable(0);
-       else event.Enable(TRUE);
-}
-void wxOsmo4Frame::OnNavPrevMenu(wxCommandEvent &event)
-{
-       u32 ID = event.GetId() - ID_NAV_PREV_0;
-       s32 prev = m_pPlayList->m_cur_entry - ID;
-       if (prev>=0) {
-               m_pPlayList->m_cur_entry = prev;
-               m_pPlayList->PlayPrev();
-       }
-}
-void wxOsmo4Frame::OnNavNext(wxCommandEvent &WXUNUSED(event))
-{
-       /*don't play if last could trigger playlist loop*/
-       if ((m_pPlayList->m_cur_entry<0) || (gf_list_count(m_pPlayList->m_entries) == 1 + (u32) m_pPlayList->m_cur_entry)) return;
-       m_pPlayList->PlayNext();
-}
-void wxOsmo4Frame::OnUpdateNavNext(wxUpdateUIEvent & event)
-{
-       if (m_pPlayList->m_cur_entry<0) event.Enable(0);
-       else if ((u32) m_pPlayList->m_cur_entry + 1 == gf_list_count(m_pPlayList->m_entries) ) event.Enable(0);
-       else event.Enable(1);
-}
-
-void wxOsmo4Frame::OnNavNextMenu(wxCommandEvent &event)
-{
-       u32 ID = event.GetId() - ID_NAV_NEXT_0;
-       s32 next = m_pPlayList->m_cur_entry + ID;
-       if (next < (s32) gf_list_count(m_pPlayList->m_entries) ) {
-               m_pPlayList->m_cur_entry = next;
-               m_pPlayList->PlayNext();
-       }
-}
-
-void wxOsmo4Frame::OnClearNav(wxCommandEvent &WXUNUSED(event))
-{
-       m_pPlayList->ClearButPlaying();
-}
-
-
-void wxOsmo4Frame::BuildStreamList(Bool reset_only)
-{
-       u32 nb_subs;
-       wxMenu *pMenu;
-
-       pMenu = sel_menu->FindItemByPosition(0)->GetSubMenu();
-       while (pMenu->GetMenuItemCount()) {
-               wxMenuItem* it = pMenu->FindItemByPosition(0);
-               pMenu->Delete(it);
-       }
-       pMenu = sel_menu->FindItemByPosition(1)->GetSubMenu();
-       while (pMenu->GetMenuItemCount()) {
-               wxMenuItem* it = pMenu->FindItemByPosition(0);
-               pMenu->Delete(it);
-       }
-       pMenu = sel_menu->FindItemByPosition(2)->GetSubMenu();
-       while (pMenu->GetMenuItemCount()) {
-               wxMenuItem* it = pMenu->FindItemByPosition(0);
-               pMenu->Delete(it);
-       }
-
-       if (reset_only) {
-               m_bFirstStreamListBuild = 1;
-               return;
-       }
-
-       if (!gf_term_get_option(m_term, GF_OPT_CAN_SELECT_STREAMS)) return;
-
-       nb_subs = 0;
-       GF_ObjectManager *root_od = gf_term_get_root_object(m_term);
-       if (!root_od) return;
-       u32 count = gf_term_get_object_count(m_term, root_od);
-
-       for (u32 i=0; i<count; i++) {
-               char szLabel[1024];
-               GF_MediaInfo info;
-               GF_ObjectManager *odm = gf_term_get_object(m_term, root_od, i);
-               if (!odm) return;
-
-               if (gf_term_get_object_info(m_term, odm, &info) != GF_OK) break;
-
-               if (info.owns_service) {
-                       char *szName = (char *) strrchr(info.service_url, '\\');
-                       if (!szName) szName = (char *) strrchr(info.service_url, '/');
-                       if (!szName) szName = (char *) info.service_url;
-                       else szName += 1;
-                       strcpy(szLabel, szName);
-                       szName = strrchr(szLabel, '.');
-                       if (szName) szName[0] = '\0';
-               }
-               switch (info.od_type) {
-               case GF_STREAM_AUDIO:
-                       pMenu = sel_menu->FindItemByPosition(0)->GetSubMenu();
-                       if (!info.owns_service) sprintf(szLabel, "Audio #"LLU, (u64)pMenu->GetMenuItemCount() + 1);
-                       pMenu->AppendCheckItem(ID_SELSTREAM_0 +i, wxString(szLabel, wxConvUTF8));
-                       break;
-               case GF_STREAM_VISUAL:
-                       pMenu = sel_menu->FindItemByPosition(1)->GetSubMenu();
-                       if (!info.owns_service) sprintf(szLabel, "Video #"LLU, (u64)pMenu->GetMenuItemCount() + 1);
-                       pMenu->AppendCheckItem(ID_SELSTREAM_0 +i, wxString(szLabel, wxConvUTF8));
-                       break;
-               case GF_STREAM_TEXT:
-                       nb_subs ++;
-                       pMenu = sel_menu->FindItemByPosition(2)->GetSubMenu();
-                       if (!info.owns_service) sprintf(szLabel, "Subtitle #"LLU, (u64)pMenu->GetMenuItemCount() + 1);
-                       pMenu->AppendCheckItem(ID_SELSTREAM_0 +i, wxString(szLabel, wxConvUTF8));
-                       break;
-               }
-       }
-       if (m_bFirstStreamListBuild) {
-               m_bFirstStreamListBuild = 0;
-               if (!nb_subs && m_lookforsubs) LookForSubtitles();
-       }
-}
-
-void wxOsmo4Frame::OnStreamSel(wxCommandEvent & event)
-{
-       GF_ObjectManager *root_od = gf_term_get_root_object(m_term);
-       if (!root_od) return;
-       u32 ID = event.GetId() - ID_SELSTREAM_0;
-       GF_ObjectManager *odm = gf_term_get_object(m_term, root_od, ID);
-       gf_term_select_object(m_term, odm);
-}
-
-void wxOsmo4Frame::OnUpdateStreamSel(wxUpdateUIEvent & event)
-{
-       GF_ObjectManager *root_od = gf_term_get_root_object(m_term);
-       if (!root_od) return;
-       u32 ID = event.GetId() - ID_SELSTREAM_0;
-
-       GF_ObjectManager *odm = gf_term_get_object(m_term, root_od, ID);
-       if (!odm) return;
-
-       GF_MediaInfo info;
-       gf_term_get_object_info(m_term, odm, &info);
-       event.Enable(1);
-       event.Check(info.status ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnUpdateStreamMenu(wxUpdateUIEvent & event)
-{
-       if (!m_connected || !gf_term_get_option(m_term, GF_OPT_CAN_SELECT_STREAMS)) {
-               event.Enable(0);
-       } else {
-               event.Enable(1);
-       }
-}
-
-void wxOsmo4Frame::OnAddSub(wxCommandEvent &WXUNUSED(event))
-{
-       wxFileDialog dlg(this, wxT("Add Subtitle"), wxT(""), wxT(""), wxT("All Subtitles|*.srt;*.ttxt|SRT Subtitles|*.srt|3GPP TimedText|*.ttxt|"), wxOPEN | wxCHANGE_DIR /* | wxHIDE_READONLY*/);
-
-       if (dlg.ShowModal() == wxID_OK) {
-               AddSubtitle(dlg.GetPath().mb_str(wxConvUTF8), 1);
-       }
-
-}
-
-void wxOsmo4Frame::AddSubtitle(const char *fileName, Bool auto_play)
-{
-       gf_term_add_object(m_term, fileName, auto_play);
-}
-
-static Bool subs_enum_dir_item(void *cbck, char *item_name, char *item_path)
-{
-       wxOsmo4Frame *_this = (wxOsmo4Frame*)cbck;
-       _this->AddSubtitle(item_path, 0);
-       return 0;
-}
-
-void wxOsmo4Frame::LookForSubtitles()
-{
-       char dir[GF_MAX_PATH];
-       const char *url = m_pPlayList->GetURL().mb_str(wxConvUTF8);
-       strcpy(dir, url);
-       char *sep = strrchr(dir, '\\');
-       if (!sep) strcpy(dir, ::wxGetCwd().mb_str(wxConvUTF8));
-       else sep[0] = 0;
-
-       gf_enum_directory(dir, 0, subs_enum_dir_item, this, "ttxt;srt");
-}
-
-void wxOsmo4Frame::OnCacheEnable(wxCommandEvent &WXUNUSED(event))
-{
-       u32 state = gf_term_get_option(m_term, GF_OPT_MEDIA_CACHE);
-       if (state==GF_MEDIA_CACHE_DISABLED) {
-               gf_term_set_option(m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_ENABLED);
-       } else if (state==GF_MEDIA_CACHE_DISABLED) {
-               gf_term_set_option(m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISABLED);
-       }
-}
-
-void wxOsmo4Frame::OnCacheStop(wxCommandEvent &WXUNUSED(event))
-{
-       gf_term_set_option(m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISABLED);
-}
-
-void wxOsmo4Frame::OnCacheAbort(wxCommandEvent &WXUNUSED(event))
-{
-       gf_term_set_option(m_term, GF_OPT_MEDIA_CACHE, GF_MEDIA_CACHE_DISCARD);
-}
-
-void wxOsmo4Frame::OnUpdateCacheEnable(wxUpdateUIEvent & event)
-{
-       u32 state = gf_term_get_option(m_term, GF_OPT_MEDIA_CACHE);
-       switch (state) {
-       case GF_MEDIA_CACHE_ENABLED:
-               event.Enable(1);
-               event.SetText(wxT("Enabled"));
-               break;
-       case GF_MEDIA_CACHE_RUNNING:
-               event.SetText(wxT("Running"));
-               event.Enable(0);
-               break;
-       case GF_MEDIA_CACHE_DISABLED:
-               event.SetText(wxT("Disabled"));
-               break;
-       }
-}
-
-void wxOsmo4Frame::OnUpdateCacheAbort(wxUpdateUIEvent & event)
-{
-       u32 state = gf_term_get_option(m_term, GF_OPT_MEDIA_CACHE);
-       event.Enable( (state==GF_MEDIA_CACHE_RUNNING) ? 1 : 0);
-}
-
-
-
-void wxOsmo4Frame::BuildChapterList(Bool reset_only)
-{
-       GF_MediaInfo odi;
-
-       while (chap_menu->GetMenuItemCount()) {
-               wxMenuItem* it = chap_menu->FindItemByPosition(0);
-               chap_menu->Delete(it);
-       }
-       if (m_chapters_start) gf_free(m_chapters_start);
-       m_chapters_start = NULL;
-       m_num_chapters = 0;
-       if (reset_only) return;
-
-       GF_ObjectManager *root_od = gf_term_get_root_object(m_term);
-       if (!root_od) return;
-       if (gf_term_get_object_info(m_term, root_od, &odi) != GF_OK) return;
-
-       u32 count = gf_list_count(odi.od->OCIDescriptors);
-       m_num_chapters = 0;
-       for (u32 i=0; i<count; i++) {
-               char szLabel[1024];
-               GF_Segment *seg = (GF_Segment *) gf_list_get(odi.od->OCIDescriptors, i);
-               if (seg->tag != GF_ODF_SEGMENT_TAG) continue;
-
-               if (seg->SegmentName && strlen((const char *)seg->SegmentName)) {
-                       strcpy(szLabel, (const char *) seg->SegmentName);
-               } else {
-                       sprintf(szLabel, "Chapter %02d", m_num_chapters+1);
-               }
-               chap_menu->AppendCheckItem(ID_SETCHAP_FIRST + m_num_chapters, wxString(szLabel, wxConvUTF8));
-
-               m_chapters_start = (Double *) gf_realloc(m_chapters_start, sizeof(Double)*(m_num_chapters+1));
-               m_chapters_start[m_num_chapters] = seg->startTime;
-               m_num_chapters++;
-       }
-
-       /*get any service info*/
-       NetInfoCommand com;
-       if (!m_bStartupFile && gf_term_get_service_info(m_term, root_od, &com) == GF_OK) {
-               wxString title = wxT("");
-               if (com.track_info) { title.Format(wxT("%02d "), (u32) (com.track_info>>16) ); }
-               if (com.artist) { title.Append(wxString(com.artist, wxConvUTF8)); title += wxT(" "); }
-               if (com.name) { title.Append(wxString(com.name, wxConvUTF8)); title += wxT(" "); }
-               if (com.album) { title += wxT("("); title.Append(wxString(com.album, wxConvUTF8)); title += wxT(")"); }
-
-               if (title.length()) SetTitle(title);
-       }
-
-}
-
-void wxOsmo4Frame::OnChapterSel(wxCommandEvent & event)
-{
-       GF_ObjectManager *root_od = gf_term_get_root_object(m_term);
-       if (!root_od) return;
-       u32 ID = event.GetId() - ID_SETCHAP_FIRST;
-       gf_term_play_from_time(m_term, (u32) (1000*m_chapters_start[ID]), 0);
-}
-
-void wxOsmo4Frame::OnUpdateChapterSel(wxUpdateUIEvent & event)
-{
-       Double now;
-       Bool is_current;
-       u32 ID = event.GetId() - ID_SETCHAP_FIRST;
-
-       now = gf_term_get_time_in_ms(m_term);
-       now /= 1000;
-
-       is_current = 0;
-       if (m_chapters_start[ID]<=now) {
-               if (ID+1<m_num_chapters) {
-                       if (m_chapters_start[ID+1]>now) is_current = 1;
-               } else {
-                       is_current = 1;
-               }
-       }
-       event.Enable(1);
-       event.Check(is_current ? 1 : 0);
-}
-
-void wxOsmo4Frame::OnUpdateChapterMenu(wxUpdateUIEvent & event)
-{
-       if (!m_connected || !m_num_chapters) {
-               event.Enable(0);
-       } else {
-               event.Enable(1);
-       }
-}
-
-void wxOsmo4Frame::OnFileCopy(wxCommandEvent &event)
-{
-       const char *text = gf_term_get_text_selection(m_term, 0);
-       if (!text) return;
-       if (!wxTheClipboard->Open()) return;
-
-       wxTheClipboard->SetData( new wxTextDataObject( wxString(text, wxConvUTF8)) );
-       wxTheClipboard->Close();
-}
-
-void wxOsmo4Frame::OnUpdateFileCopy(wxUpdateUIEvent &event)
-{
-       if (gf_term_get_text_selection(m_term, 1)!=NULL) {
-               event.Enable(1);
-       } else {
-               event.Enable(0);
-       }
-}
-
-void wxOsmo4Frame::OnFilePaste(wxCommandEvent &event)
-{
-       if (!wxTheClipboard->Open()) return;
-    if (wxTheClipboard->IsSupported( wxDF_TEXT )) {
-               wxTextDataObject data;
-               wxTheClipboard->GetData(data);
-               gf_term_paste_text(m_term, data.GetText().mb_str(wxConvUTF8), 0);
-       }
-       wxTheClipboard->Close();
-}
-
-void wxOsmo4Frame::OnUpdateFilePaste(wxUpdateUIEvent &event)
-{
-       Bool ok = 0;
-       if (wxTheClipboard->Open()) {
-           if (wxTheClipboard->IsSupported( wxDF_TEXT )) {
-                       if (gf_term_paste_text(m_term, NULL, 1)==GF_OK) {
-                               ok = 1;
-                       }
-               }
-               wxTheClipboard->Close();
-       }
-       event.Enable(ok ? 1 : 0);
-}
-
diff --git a/applications/osmo4_wx/wxOsmo4.h b/applications/osmo4_wx/wxOsmo4.h
deleted file mode 100644 (file)
index 6c2b463..0000000
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) Jean Le Feuvre 2000-2005
- *                                     All rights reserved
- *
- *  This file is part of GPAC / Osmo4 wxWidgets GUI
- *
- *  GPAC is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- */
-
-#ifndef _WXOSMO4_H
-#define _WXOSMO4_H
-
-/*
-we need to force X to work in sync mode when we use embedded view...
-include first to avoid Bool type redef between X11 and gpac
-*/
-#ifdef __WXGTK__
-#include <X11/Xlib.h>
-#endif
-
-#include "wx/wxprec.h"
-
-#ifndef WX_PRECOMP
-#include "wx/wx.h"
-#endif
-
-#include <wx/image.h>
-#include <wx/listctrl.h>
-#include <wx/event.h>
-#include "menubtn.h"
-
-/*include gpac AFTER wx in case we override malloc/realloc/free for mem tracking*/
-#include <gpac/terminal.h>
-#include <gpac/term_info.h>
-
-class wxOsmo4App : public wxApp
-{
-public:
-       virtual bool OnInit();
-};
-
-DECLARE_APP(wxOsmo4App)
-
-class wxOsmo4Frame;
-class wxPlaylist;
-
-class GPACLogs : public wxLogWindow {
-public:
-    GPACLogs(wxFrame *parent) : wxLogWindow(parent, wxT("GPAC Logs"), FALSE, FALSE) {
-               m_pMain = (wxOsmo4Frame *) parent;
-       }
-       virtual bool OnFrameClose(wxFrame *frame);
-
-private:
-       wxOsmo4Frame *m_pMain;
-};
-
-#define MAX_VIEWPOINTS 50
-
-// Menu commands
-enum
-{
-       GWX_FILE_OPEN = wxID_HIGHEST,
-       GWX_FILE_OPEN_URL,
-       FILE_RELOAD,
-       FILE_RELOAD_CONFIG,
-       FILE_PLAY,
-       FILE_STEP,
-       FILE_STOP,
-       FILE_PREV,
-       FILE_NEXT,
-       FILE_PROPERTIES,
-       FILE_COPY,
-       FILE_PASTE,
-       TERM_RELOAD,
-       FILE_QUIT,
-       VIEW_FULLSCREEN,
-       VIEW_ORIGINAL,
-       VIEW_AR_KEEP,
-       VIEW_AR_FILL,
-       VIEW_AR_43,
-       VIEW_AR_169,
-       VIEW_OPTIONS,
-       VIEW_LOGS,
-       VIEW_RTI,
-       VIEW_PLAYLIST,
-       SWITCH_RENDER,
-       APP_SHORTCUTS,
-       APP_NAV_KEYS,
-       APP_ABOUT,
-       ID_ADDRESS,
-       ID_URL_GO,
-       ID_ABOUT_CLOSE,
-       ID_CLEAR_NAV,
-       ID_STREAM_MENU,
-       ID_CHAPTER_MENU,
-       ID_ADD_SUB,
-
-       ID_MCACHE_ENABLE,
-       ID_MCACHE_STOP,
-       ID_MCACHE_ABORT,
-
-       ID_CTRL_TIMER,
-       ID_SLIDER,
-
-       ID_TREE_VIEW,
-       ID_OD_TIMER,
-       ID_VIEW_SG,
-       ID_VIEW_WI,
-       ID_VIEW_SEL,
-
-
-       ID_HEADLIGHT,
-       ID_NAVIGATE_NONE,
-       ID_NAVIGATE_WALK,
-       ID_NAVIGATE_FLY,
-       ID_NAVIGATE_EXAMINE,
-       ID_NAVIGATE_SLIDE,
-       ID_NAVIGATE_PAN,
-       ID_NAVIGATE_ORBIT,
-       ID_NAVIGATE_GAME,
-       ID_NAVIGATE_RESET,
-
-       ID_COLLIDE_NONE,
-       ID_COLLIDE_REG,
-       ID_COLLIDE_DISP,
-       ID_GRAVITY,
-
-       ID_PL_OPEN,
-       ID_PL_SAVE,
-       ID_PL_ADD_FILE,
-       ID_PL_ADD_URL,
-       ID_PL_ADD_DIR,
-       ID_PL_ADD_DIR_REC,
-       ID_PL_REM_FILE,
-       ID_PL_REM_ALL,
-       ID_PL_REM_DEAD,
-       ID_PL_UP,
-       ID_PL_DOWN,
-       ID_PL_RANDOMIZE,
-       ID_PL_REVERSE,
-       ID_PL_SEL_REV,
-       ID_PL_SORT_TITLE,
-       ID_PL_SORT_FILE,
-       ID_PL_SORT_DUR,
-       ID_PL_PLAY,
-
-
-       /*reserve IDs for viewpoint menu*/
-       ID_VIEWPOINT_FIRST,
-       ID_VIEWPOINT_LAST = ID_VIEWPOINT_FIRST + MAX_VIEWPOINTS,
-
-       /*reserve IDs for navigation menus*/
-       ID_NAV_PREV_0,
-       ID_NAV_PREV_9 = ID_NAV_PREV_0 + 10,
-       ID_NAV_NEXT_0,
-       ID_NAV_NEXT_9 = ID_NAV_NEXT_0 + 10,
-       /*reserve IDs for stream selection menus*/
-       ID_SELSTREAM_0,
-       ID_SELSTREAM_9 = ID_SELSTREAM_0 + 10,
-
-       /*reserve IDs for chapter selection menus*/
-       ID_SETCHAP_FIRST,
-       ID_SETCHAP_LAST = ID_SELSTREAM_0 + 200,
-};
-
-wxString get_pref_browser(GF_Config *cfg);
-
-class wxGPACEvent : public wxEvent
-{
-public:
-       wxGPACEvent( wxWindow* win = (wxWindow*) NULL );
-       void CopyObject( wxObject& obj ) const;
-       virtual wxEvent *Clone() const;
-
-       wxString to_url;
-       GF_Event gpac_evt;
-
-       DECLARE_DYNAMIC_CLASS(wxGPACEvent)
-};
-typedef void (wxEvtHandler::*GPACEventFunction)(wxGPACEvent&);
-DEFINE_EVENT_TYPE(GPAC_EVENT)
-
-#define EVT_GPACEVENT(func) DECLARE_EVENT_TABLE_ENTRY(GPAC_EVENT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (GPACEventFunction) & func, (wxObject*) NULL),
-
-class OpenURLDlg : public wxDialog {
-public:
-    OpenURLDlg(wxWindow *parent, GF_Config *cfg);
-       wxString m_urlVal;
-private:
-    wxButton *m_go;
-    wxComboBox *m_url;
-       GF_Config *m_cfg;
-       void OnGo(wxCommandEvent& event);
-    DECLARE_EVENT_TABLE()
-};
-
-class wxMyComboBox : public wxComboBox
-{
-public:
-       wxMyComboBox(wxWindow* parent, wxWindowID id, const wxString& value = wxT(""), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize)
-               : wxComboBox(parent, id, value, pos, size, 0, NULL, wxCB_DROPDOWN)
-       {}
-
-private:
-       DECLARE_EVENT_TABLE()
-
-       void OnKeyUp(wxKeyEvent &event);
-};
-
-class wxOsmo4Frame : public wxFrame {
-public:
-    wxOsmo4Frame();
-    virtual ~wxOsmo4Frame();
-
-       char szAppPath[GF_MAX_PATH];
-
-       u32 m_duration;
-       wxString the_next_url;
-       GF_Terminal *m_term;
-       GF_User m_user;
-       Bool m_connected, m_can_seek, m_console_off, m_loop, m_lookforsubs;
-
-       void DoConnect();
-
-       void ConnectAcknowledged(Bool bOk);
-       void SetStatus(wxString str);
-
-       void OnFilePlay(wxCommandEvent &event);
-       void OnFileStep(wxCommandEvent &event);
-       void OnFileStop(wxCommandEvent &event);
-       wxString GetFileFilter();
-
-       void BuildViewList();
-       void BuildStreamList(Bool reset_only);
-       void BuildChapterList(Bool reset_only);
-
-       void AddSubtitle(const char *fileName, Bool auto_play);
-
-       wxWindow *m_pView;
-
-#ifdef __WXGTK__
-       u32 m_last_grab_time, m_last_grab_pos;
-       wxWindow *m_pVisual;
-#endif
-       wxSlider *m_pProg;
-       wxPlaylist *m_pPlayList;
-
-       void DoLayout(u32 v_width = 0, u32 v_height = 0);
-       s32 m_last_prog;
-
-       FILE *m_logs;
-       u32 m_log_level, m_log_tools;
-       u32 m_LastStatusTime;
-
-protected:
-
-private:
-       DECLARE_EVENT_TABLE()
-
-       void OnCloseApp(wxCloseEvent &event);
-       void OnSize(wxSizeEvent &event);
-
-       void OnFileOpen(wxCommandEvent &event);
-       void OnFileOpenURL(wxCommandEvent &event);
-       void OnFileReload(wxCommandEvent &event);
-       void OnFileReloadConfig(wxCommandEvent & event);
-       void OnFileProperties(wxCommandEvent &event);
-       void OnFileQuit(wxCommandEvent &event);
-       void OnFullScreen(wxCommandEvent &event);
-       void OnOptions(wxCommandEvent &event);
-       void OnViewARKeep(wxCommandEvent &event);
-       void OnViewARFill(wxCommandEvent &event);
-       void OnViewAR169(wxCommandEvent &event);
-       void OnViewAR43(wxCommandEvent &event);
-       void OnViewOriginal(wxCommandEvent &event);
-       void OnPlaylist(wxCommandEvent &event);
-       void OnShortcuts(wxCommandEvent &event);
-       void OnNavInfo(wxCommandEvent &event);
-       void OnAddSub(wxCommandEvent &event);
-       void OnAbout(wxCommandEvent &event);
-       Bool LoadTerminal();
-       void OnGPACEvent(wxGPACEvent &event);
-       void OnTimer(wxTimerEvent& event);
-       void OnSlide(wxScrollEvent &event);
-       void OnRelease(wxScrollEvent &event);
-       void OnLogs(wxCommandEvent & event);
-       void OnRTI(wxCommandEvent & event);
-       void OnUpdatePlay(wxUpdateUIEvent &event);
-       void OnUpdateNeedsConnect(wxUpdateUIEvent &event);
-       void OnUpdateFullScreen(wxUpdateUIEvent &event);
-       void OnUpdateAR(wxUpdateUIEvent &event);
-       void OnViewport(wxCommandEvent & event);
-       void OnUpdateViewport(wxUpdateUIEvent & event);
-       void OnNavigate(wxCommandEvent & event);
-       void OnNavigateReset(wxCommandEvent & event);
-       void OnUpdateNavigation(wxUpdateUIEvent & event);
-       void OnRenderSwitch(wxCommandEvent &event);
-       void OnCollide(wxCommandEvent & event);
-       void OnUpdateCollide(wxUpdateUIEvent & event);
-       void OnHeadlight(wxCommandEvent & event);
-       void OnUpdateHeadlight(wxUpdateUIEvent & event);
-       void OnGravity(wxCommandEvent & event);
-       void OnUpdateGravity(wxUpdateUIEvent & event);
-       void OnURLSelect(wxCommandEvent &event);
-       void OnUpdatePlayList(wxUpdateUIEvent & event);
-       void OnFilePrevOpen(wxNotifyEvent & event);
-       void OnFileNextOpen(wxNotifyEvent & event);
-       void OnNavPrev(wxCommandEvent &event);
-       void OnUpdateNavPrev(wxUpdateUIEvent & event);
-       void OnNavPrevMenu(wxCommandEvent &event);
-       void OnNavNext(wxCommandEvent &event);
-       void OnUpdateNavNext(wxUpdateUIEvent & event);
-       void OnNavNextMenu(wxCommandEvent &event);
-       void OnClearNav(wxCommandEvent &event);
-       void OnStreamSel(wxCommandEvent &event);
-       void OnUpdateStreamSel(wxUpdateUIEvent & event);
-       void OnUpdateStreamMenu(wxUpdateUIEvent & event);
-       void OnChapterSel(wxCommandEvent &event);
-       void OnUpdateChapterSel(wxUpdateUIEvent & event);
-       void OnUpdateChapterMenu(wxUpdateUIEvent & event);
-
-       void SelectionReady();
-       void ReloadURLs();
-       void LookForSubtitles();
-
-       void OnCacheEnable(wxCommandEvent &event);
-       void OnCacheStop(wxCommandEvent &event);
-       void OnCacheAbort(wxCommandEvent &event);
-       void OnUpdateCacheEnable(wxUpdateUIEvent & event);
-       void OnUpdateCacheAbort(wxUpdateUIEvent & event);
-
-       void OnFileCopy(wxCommandEvent &event);
-       void OnUpdateFileCopy(wxUpdateUIEvent &event);
-       void OnFilePaste(wxCommandEvent &event);
-       void OnUpdateFilePaste(wxUpdateUIEvent &event);
-
-
-       void CheckVideoOut();
-
-    wxMenuBar* m_pMenubar;
-    wxStatusBar* m_pStatusbar;
-       wxTimer *m_pTimer;
-       GPACLogs *m_pLogs;
-       wxBoxSizer *m_pAddBar;
-
-       Bool m_bGrabbed, m_bToReset, m_bFirstStreamListBuild;
-       wxBitmap *m_pOpenFile, *m_pPrev, *m_pNext, *m_pPlay, *m_pPause, *m_pStep, *m_pStop, *m_pInfo, *m_pConfig, *m_pSW2D, *m_pSW3D;
-       wxMenuButton *m_pPrevBut, *m_pNextBut;
-       wxToolBar *m_pToolBar;
-       wxMyComboBox *m_Address;
-
-       wxMenu *vp_list;
-       wxMenu *sel_menu;
-       wxMenu *chap_menu;
-       void Stop();
-
-       s32 nb_viewpoints;
-
-       void UpdateRenderSwitch();
-       void UpdatePlay();
-
-       u32 m_orig_width, m_orig_height;
-
-       u32 m_num_chapters;
-       Double *m_chapters_start;
-       Bool m_bExternalView, m_bViewRTI, m_bStartupFile;
-
-       void ShowViewWindow(Bool do_show);
-};
-
-
-#endif  //_WXOSMO4_H
-
diff --git a/applications/osmo4_wx/wxOsmo4.rc b/applications/osmo4_wx/wxOsmo4.rc
deleted file mode 100644 (file)
index 3e839b8..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// French (France) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
-#ifdef _WIN32
-LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
-    "#include ""afxres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
-    "\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_OSMO_ICON               ICON    DISCARDABLE     "../../doc/osmo4.ico"
-#endif    // French (France) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
diff --git a/applications/osmophone/Osmo4.ico b/applications/osmophone/Osmo4.ico
deleted file mode 100644 (file)
index d544ffc..0000000
Binary files a/applications/osmophone/Osmo4.ico and /dev/null differ
diff --git a/applications/osmophone/main.cpp b/applications/osmophone/main.cpp
deleted file mode 100644 (file)
index 53a7cbc..0000000
+++ /dev/null
@@ -1,1474 +0,0 @@
-/*
- *                     GPAC - Multimedia Framework C SDK
- *
- *                     Copyright (c) Jean Le Feuvre 2000-2005
- *                                     All rights reserved
- *
- *  This file is part of GPAC / command-line client
- *
- *  GPAC is gf_free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *   
- *  GPAC is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *   
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
- *
- */
-
-/*includes both terminal and od browser*/
-#include <gpac/terminal.h>
-#include <gpac/options.h>
-/*for initial setup*/
-#include <gpac/modules/service.h>
-
-#include <gpac/internal/terminal_dev.h>
-#include <gpac/internal/compositor_dev.h>
-
-#include <windows.h>
-#include <commdlg.h>
-#include <commctrl.h>
-
-#ifdef _WIN32_WCE
-#include <aygshell.h>
-#include <gx.h>
-
-#else
-
-#ifndef _T
-#define _T(__a) (LPCSTR) __a
-#endif
-
-#endif
-
-#include "resource.h"
-
-#define WM_LOADTERM    WM_USER + 1
-#define STATE_TIMER_ID         20
-#define STATE_TIMER_DUR                1000
-#define GPAC_TIMER_ID          21
-#define GPAC_TIMER_DUR         33
-
-
-Bool gf_file_dialog(HINSTANCE inst, HWND parent, char *url, const char *ext_list, GF_Config *cfg);
-void set_backlight_state(Bool disable);
-void refresh_recent_files();
-void do_layout(Bool notif_size);
-
-static HWND g_hwnd = NULL;
-static HWND g_hwnd_disp = NULL;
-static HWND g_hwnd_menu = NULL;
-static HWND g_hwnd_status = NULL;
-static HINSTANCE g_hinst = NULL;
-static Bool is_ppc = 0;
-
-static Bool is_connected = 0;
-static Bool navigation_on = 0;
-static Bool playlist_navigation_on = 1;
-
-static u32 Duration;
-static Bool CanSeek = 0;
-static u32 Volume=100;
-static char the_url[GF_MAX_PATH] = "";
-static Bool NavigateTo = 0;
-static char the_next_url[GF_MAX_PATH];
-static GF_Terminal *term;
-static GF_User user;
-static u32 disp_w = 0;
-static u32 disp_h = 0;
-static u32 screen_w = 0;
-static u32 screen_h = 0;
-static u32 menu_h = 0;
-static u32 caption_h = 0;
-static u32 ratio_h = 1;
-static Bool backlight_off = 0;
-static u32 prev_batt_bl, prev_ac_bl;
-static Bool show_status = 1;
-static Bool reset_status = 1;
-static u32 last_state_time = 0;
-static Bool loop = 0;
-static Bool full_screen = 0;
-static Bool force_2d_gl = 0;
-static Bool ctrl_mod_down = 0;
-static Bool view_cpu = 1;
-static Bool use_low_fps = 0;
-static Bool use_svg_prog = 0;
-
-static Bool log_rti = 0;
-static FILE *log_file = NULL;
-static u32 rti_update_time_ms = 200;
-
-static u32 playlist_act = 0;
-
-
-void recompute_res(u32 sw, u32 sh )
-{
-       caption_h = GetSystemMetrics(SM_CYCAPTION);
-       menu_h = GetSystemMetrics(SM_CYMENU)+2;
-       screen_w = GetSystemMetrics(SM_CXSCREEN);
-       screen_h = GetSystemMetrics(SM_CYSCREEN);
-
-       ratio_h = sh / screen_h;
-       screen_w = sw;
-       screen_h = sh;
-       menu_h *= ratio_h;
-//     caption_h *= ratio_h;
-       disp_w = screen_w;
-       disp_h = screen_h - menu_h /*- caption_h*/;
-}
-
-
-void set_status(char *state)
-{
-       if (show_status && g_hwnd_status) {
-#ifdef _WIN32_WCE
-               TCHAR wstate[1024];
-               CE_CharToWide(state, (u16 *) wstate);
-               SendMessage(g_hwnd_status, WM_SETTEXT, 0, (LPARAM) wstate);
-#else
-               SendMessage(g_hwnd_status, WM_SETTEXT, 0, (LPARAM) state);
-#endif
-               last_state_time = GetTickCount();
-       }
-}
-
-void update_state_info()
-{
-       TCHAR wstate[1024];
-       Double FPS;
-       u32 time, m, s;
-       if (!show_status) return;
-       if (last_state_time) {
-               if (GetTickCount() > last_state_time + 200) {
-                       last_state_time = 0;
-                       reset_status = 1;
-               }
-               else return;
-       }
-       if (!term) return;
-       if (!is_connected && reset_status) {
-               SendMessage(g_hwnd_status, WM_SETTEXT, 0, (LPARAM) TEXT("Ready") );
-               reset_status = 0;
-               return;
-       }
-
-       FPS = gf_term_get_framerate(term, 0);
-       time = gf_term_get_time_in_ms(term) / 1000;
-       m = time/60;
-       s = time - m*60;
-       if (view_cpu) {
-               GF_SystemRTInfo rti;
-               if (!gf_sys_get_rti(STATE_TIMER_DUR, &rti, 0)) return;
-               wsprintf(wstate, TEXT("T %02d:%02d : FPS %02.2f : CPU %02d"), m, s, FPS, rti.total_cpu_usage);
-       } else {
-               wsprintf(wstate, TEXT("T %02d:%02d : FPS %02.2f"), m, s, FPS);
-       }
-       SendMessage(g_hwnd_status, WM_SETTEXT, 0, (LPARAM) wstate);
-}
-
-
-static u64 prev_pos = 0;
-void cbk_on_progress(void *_title, u64 done, u64 total)
-{
-#if 0
-       char szMsg[1024];
-       u32 pos = (u32) ((u64) done * 100)/total;
-       if (pos<prev_pos) prev_pos = 0;
-       if (pos!=prev_pos) {
-               prev_pos = pos;
-               sprintf(szMsg, "%s: (%02d/100)", _title ? (char *)_title : "", pos);
-               set_status(szMsg);
-       }
-#endif
-}
-
-void set_full_screen()
-{
-       full_screen = !full_screen;
-       if (full_screen) {
-               show_status = 0;
-               do_layout(0);
-               gf_term_set_option(term, GF_OPT_FULLSCREEN, full_screen);
-       } else {
-               const char *str = gf_cfg_get_key(user.config, "General", "ShowStatusBar");
-               show_status = (str && !strcmp(str, "yes")) ? 1 : 0;
-               gf_term_set_option(term, GF_OPT_FULLSCREEN, full_screen);
-               do_layout(1);
-       }
-}
-
-
-static void on_gpac_rti_log(void *cbk, u32 ll, u32 lm, const char *fmt, va_list list)
-{
-       if (!log_file) return;
-
-       if (lm & GF_LOG_RTI) {
-               GF_SystemRTInfo rti;
-               if (fmt) vfprintf(log_file, fmt, list); 
-       
-               gf_sys_get_rti(rti_update_time_ms, &rti, 0);
-       
-               fprintf(log_file, "% 8d\t% 8d\t% 8d\t% 4d\t% 8d\t\t", 
-                       gf_sys_clock(),
-                       gf_term_get_time_in_ms(term),
-                       rti.total_cpu_usage,
-                       (u32) gf_term_get_framerate(term, 0),
-                       (u32) ( rti.gpac_memory / 1024)
-               );
-       } else if (fmt && (ll>=GF_LOG_INFO)) {
-               vfprintf(log_file, fmt, list);  
-       }
-}
-static void on_gpac_log(void *cbk, u32 ll, u32 lm, const char *fmt, va_list list)
-{
-       if (fmt && log_file) vfprintf(log_file, fmt, list);     
-}
-
-
-static void setup_logs()
-{
-       if (log_file) fclose(log_file);
-       log_file = NULL;
-
-       gf_log_set_level(GF_LOG_ERROR);
-       gf_log_set_tools(0);
-       gf_log_set_callback(NULL, NULL);
-
-       if (log_rti) {
-               log_file = gf_f64_open("\\gpac_logs.txt", "a+t");
-
-               fprintf(log_file, "!! GPAC RunTime Info for file %s !!\n", the_url);
-               fprintf(log_file, "SysTime(ms)\tSceneTime(ms)\tCPU\tFPS\tMemory(kB)\tObservation\n");
-
-               gf_log_set_level(GF_LOG_DEBUG);
-               gf_log_set_tools(GF_LOG_RTI|GF_LOG_SCRIPT);
-               gf_log_set_callback(log_file, on_gpac_rti_log);
-
-               GF_LOG(GF_LOG_DEBUG, GF_LOG_RTI, ("[RTI] System state when enabling log\n"));
-       } else {
-               u32 lt, ll;
-               ll = gf_log_parse_level( gf_cfg_get_key(user.config, "General", "LogLevel") );
-               gf_log_set_level(ll);
-               lt = gf_log_parse_tools( gf_cfg_get_key(user.config, "General", "LogTools") );
-               gf_log_set_tools(lt);
-
-               if (ll && (log_file = gf_f64_open("\\gpac_logs.txt", "a+t"))) {
-                       gf_log_set_callback(log_file, on_gpac_log);
-               }
-
-       }
-}
-
-void do_open_file()
-{
-       gf_cfg_set_key(user.config, "RecentFiles", the_url, NULL);
-       gf_cfg_insert_key(user.config, "RecentFiles", the_url, "", 0);
-       u32 count = gf_cfg_get_key_count(user.config, "RecentFiles");
-       if (count > 10) gf_cfg_set_key(user.config, "RecentFiles", gf_cfg_get_key_name(user.config, "RecentFiles", count-1), NULL);
-
-       setup_logs();
-
-       gf_term_connect(term, the_url);
-}
-
-void switch_playlist(Bool play_prev)
-{
-       char szPLE[20];
-       u32 idx = 0;
-       u32 count;
-       const char *ple = gf_cfg_get_key(user.config, "General", "PLEntry");
-       if (ple) idx = atoi(ple);
-       
-       count = gf_cfg_get_key_count(user.config, "Playlist");
-       if (!count) return;
-       /*not the first launch*/
-       if (strlen(the_url)) {
-               if (!idx && play_prev) return;
-               if (play_prev) idx--;
-               else idx++;
-               if (idx>=count) return;
-       } else {
-               if (idx>=count) idx=0;
-       }
-
-       ple = gf_cfg_get_key_name(user.config, "Playlist", idx);
-       if (!ple) return;
-
-       sprintf(szPLE, "%d", idx);
-       gf_cfg_set_key(user.config, "General", "PLEntry", szPLE);
-
-       strcpy(the_url, ple);
-       do_open_file();
-}
-
-
-Bool GPAC_EventProc(void *ptr, GF_Event *evt)
-{
-       switch (evt->type) {
-       case GF_EVENT_DURATION:
-               Duration = (u32) (evt->duration.duration*1000);
-               CanSeek = evt->duration.can_seek;
-               break;
-       case GF_EVENT_MESSAGE:
-       {
-               if (!evt->message.message) return 0;
-               if (evt->message.error==GF_SCRIPT_INFO) {
-                       GF_LOG(GF_LOG_INFO, GF_LOG_SCRIPT, ("[Script] %s\n", evt->message.message));
-               }
-               //set_status((char *) evt->message.message);
-       }
-               break;
-       case GF_EVENT_PROGRESS:
-       {
-               char *szTitle = "";
-               if (evt->progress.progress_type==0) szTitle = "Buffer ";
-               else if (evt->progress.progress_type==1) szTitle = "Download ";
-               else if (evt->progress.progress_type==2) szTitle = "Import ";
-               cbk_on_progress(szTitle, evt->progress.done, evt->progress.total);
-       }
-               break;
-       
-       case GF_EVENT_SIZE:
-               break;
-       case GF_EVENT_RESOLUTION:
-               recompute_res(evt->size.width, evt->size.height);
-               do_layout(1);
-               break;
-
-       case GF_EVENT_SCENE_SIZE:
-               do_layout(1);
-               break;
-       case GF_EVENT_DBLCLICK:
-               set_full_screen();
-               return 0;
-       case GF_EVENT_CONNECT:
-               if (evt->connect.is_connected) {
-                       is_connected = 1;
-                       if (!backlight_off) set_backlight_state(1);
-                       refresh_recent_files();
-                       navigation_on = (gf_term_get_option(term, GF_OPT_NAVIGATION)==GF_NAVIGATE_NONE) ? 0 : 1;
-               } else {
-                       navigation_on = 0;
-                       is_connected = 0;
-                       Duration = 0;
-               }
-               break;
-       case GF_EVENT_EOS:
-               if (Duration>2000)
-                       gf_term_play_from_time(term, 0, 0);
-               break;
-       case GF_EVENT_QUIT:
-               PostMessage(g_hwnd, WM_DESTROY, 0, 0);
-               break;
-       case GF_EVENT_KEYDOWN:
-               switch (evt->key.key_code) {
-               case GF_KEY_ENTER:
-                       if (full_screen) set_full_screen();
-                       break;
-               case GF_KEY_1:
-                       ctrl_mod_down = !ctrl_mod_down;
-                       evt->key.key_code = GF_KEY_CONTROL;
-                       evt->type = ctrl_mod_down ? GF_EVENT_KEYDOWN : GF_EVENT_KEYUP;
-                       gf_term_user_event(term, evt);
-                       break;
-               case GF_KEY_MEDIAPREVIOUSTRACK:
-                       playlist_act = 2;
-                       break;
-               case GF_KEY_MEDIANEXTTRACK:
-                       playlist_act = 1;
-                       break;
-               }
-               break;
-       case GF_EVENT_NAVIGATE:
-               if (gf_term_is_supported_url(term, evt->navigate.to_url, 1, 1)) {
-                       gf_term_navigate_to(term, evt->navigate.to_url);
-                       return 1;
-               } else {
-#ifdef _WIN32_WCE
-                       u16 dst[1024];
-#endif
-                       SHELLEXECUTEINFO info;
-
-/*
-                       if (full_screen) gf_term_set_option(term, GF_OPT_FULLSCREEN, 0);
-                       full_screen = 0;
-*/
-                       memset(&info, 0, sizeof(SHELLEXECUTEINFO));
-                       info.cbSize = sizeof(SHELLEXECUTEINFO);
-                       info.lpVerb = _T("open");
-                       info.fMask = SEE_MASK_NOCLOSEPROCESS;
-                       info.lpFile = _T("iexplore");
-#ifdef _WIN32_WCE
-                       CE_CharToWide((char *) evt->navigate.to_url, dst);
-                       info.lpParameters = (LPCTSTR) dst;
-#else
-                       info.lpParameters = evt->navigate.to_url;
-#endif
-                       info.nShow = SW_SHOWNORMAL;
-                       ShellExecuteEx(&info);
-               }
-               return 1;
-       }
-       return 0;
-}
-
-//#define TERM_NOT_THREADED
-
-Bool LoadTerminal()
-{
-       /*by default use current dir*/
-       strcpy(the_url, ".");
-
-       setup_logs();
-
-       g_hwnd_disp = CreateWindow(TEXT("STATIC"), NULL, WS_CHILD | WS_VISIBLE , 0, 0, disp_w, disp_h, g_hwnd, NULL, g_hinst, NULL);
-
-       user.EventProc = GPAC_EventProc;
-       /*dummy in this case (global vars) but MUST be non-NULL*/
-       user.opaque = user.modules;
-       user.os_window_handler = g_hwnd_disp;
-#ifdef TERM_NOT_THREADED
-       user.init_flags = GF_TERM_NO_DECODER_THREAD | GF_TERM_NO_COMPOSITOR_THREAD | GF_TERM_NO_REGULATION;
-#endif
-
-       term = gf_term_new(&user);
-       if (!term) {
-               gf_modules_del(user.modules);
-               gf_cfg_del(user.config);
-               memset(&user, 0, sizeof(GF_User));
-               return 0;
-       }
-
-#ifdef _WIN32_WCE
-       screen_w = term->compositor->video_out->max_screen_width;
-       screen_h = term->compositor->video_out->max_screen_height;
-       disp_w = screen_w;
-       disp_h = screen_h - menu_h /*- caption_h*/;
-#endif
-
-#ifdef TERM_NOT_THREADED
-       ::SetTimer(g_hwnd, GPAC_TIMER_ID, GPAC_TIMER_DUR, NULL);
-#endif
-
-       const char *str = gf_cfg_get_key(user.config, "General", "StartupFile");
-       if (str) {
-               do_layout(1);
-               strcpy(the_url, str);
-               gf_term_connect(term, str);
-       }
-       return 1;
-}
-
-void do_layout(Bool notif_size)
-{
-       u32 w, h;
-       if (full_screen) {
-               w = screen_w;
-               h = screen_h;
-               ::ShowWindow(g_hwnd_status, SW_HIDE);
-#ifdef _WIN32_WCE
-               ::ShowWindow(g_hwnd_menu, SW_HIDE);
-#endif
-
-#ifdef _WIN32_WCE
-               SHFullScreen(g_hwnd, SHFS_HIDESIPBUTTON);
-#endif
-               ::MoveWindow(g_hwnd, 0, 0, screen_w, screen_h, 1);
-               ::MoveWindow(g_hwnd_disp, 0, 0, screen_w, screen_h, 1);
-               SetForegroundWindow(g_hwnd_disp);
-       } else {
-#ifdef _WIN32_WCE
-               ::ShowWindow(g_hwnd_menu, SW_SHOW);
-#endif
-               if (show_status) {
-                       ::MoveWindow(g_hwnd, 0, 0, disp_w, disp_h, 1);
-                       ::ShowWindow(g_hwnd_status, SW_SHOW);
-                       ::MoveWindow(g_hwnd_status, 0, 0, disp_w, caption_h, 1);
-                       ::MoveWindow(g_hwnd_disp, 0, caption_h, disp_w, disp_h - caption_h, 1);
-                       w = disp_w;
-                       h = disp_h - caption_h*ratio_h;
-               } else {
-                       ::ShowWindow(g_hwnd_status, SW_HIDE);
-//                     ::MoveWindow(g_hwnd, 0, caption_h, disp_w, disp_h, 1);
-                       ::MoveWindow(g_hwnd, 0, 0, disp_w, disp_h, 1);
-                       ::MoveWindow(g_hwnd_disp, 0, 0, disp_w, disp_h, 1);
-                       w = disp_w;
-                       h = disp_h;
-               }
-       }
-       if (notif_size && term) gf_term_set_size(term, w, h);
-}
-
-
-void set_backlight_state(Bool disable) 
-{
-#ifdef _WIN32_WCE
-       HKEY hKey = 0;
-       DWORD dwSize;
-       DWORD dwValue;
-       HANDLE hBL;
-       if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("ControlPanel\\Backlight"), 0, 0, &hKey ) != ERROR_SUCCESS) return;
-
-       if (disable) {
-               dwSize = 4;
-               RegQueryValueEx(hKey, _T("BatteryTimeout"), NULL, NULL,(unsigned char*) &prev_batt_bl, &dwSize);
-               dwSize = 4;
-               RegQueryValueEx(hKey, _T("ACTimeout"), NULL, NULL, (unsigned char*) &prev_ac_bl,&dwSize);
-               dwSize = 4;
-               dwValue = 0xefff ;
-               RegSetValueEx(hKey, _T("BatteryTimeout"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
-               dwSize = 4;
-               dwValue = 0xefff ;
-               RegSetValueEx( hKey, _T("ACTimeout"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
-               backlight_off = 1;
-       } else {
-               if (prev_batt_bl) {
-                       dwSize = 4;
-                       RegSetValueEx(hKey, _T("BatteryTimeout"), NULL, REG_DWORD, (unsigned char *)&prev_batt_bl, dwSize);
-               }
-               if (prev_ac_bl) {
-                       dwSize = 4;
-                       RegSetValueEx(hKey, _T("ACTimeout"), NULL, REG_DWORD,(unsigned char *)&prev_ac_bl, dwSize);
-               }
-               backlight_off = 0;
-       }
-       RegCloseKey(hKey);
-       hBL = CreateEvent(NULL, FALSE, FALSE, _T("BackLightChangeEvent"));
-       if (hBL) {
-               SetEvent(hBL);
-               CloseHandle(hBL);
-       }
-#endif
-}
-
-static Bool do_resume = 0;
-static Bool prev_backlight_state;
-void gf_freeze_display(Bool do_gf_freeze)
-{
-       if (do_gf_freeze) {
-               prev_backlight_state = backlight_off;
-               do_resume = 0;
-               if (0 && is_connected && gf_term_get_option(term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
-                       do_resume= 1;
-                       gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
-               }
-               /*gf_freeze display*/
-               gf_term_set_option(term, GF_OPT_FREEZE_DISPLAY, 1);
-               
-               set_backlight_state(0);
-               gf_sleep(100);
-       } else {
-               if (prev_backlight_state) set_backlight_state(1);
-               gf_term_set_option(term, GF_OPT_FREEZE_DISPLAY, 0);
-
-               if (do_resume) {
-                       gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
-                       set_backlight_state(1);
-               }       
-       }
-}
-
-static void show_taskbar(Bool show_it)
-{
-#ifdef _WIN32_WCE
-       HWND wnd;
-       if (!is_ppc) return;
-
-       wnd = GetForegroundWindow();
-       wnd = g_hwnd;
-       if (show_it) {
-               SHFullScreen(wnd, SHFS_SHOWSTARTICON | SHFS_SHOWTASKBAR| SHFS_SHOWSIPBUTTON);
-               ::ShowWindow(::FindWindow(_T("HHTaskbar"),NULL), SW_SHOWNA);
-       } else {
-               ::ShowWindow(::FindWindow(_T("HHTaskbar"),NULL), SW_HIDE);
-               SHFullScreen(wnd, SHFS_HIDESTARTICON | SHFS_HIDETASKBAR| SHFS_HIDESIPBUTTON);
-       }
-#endif
-}
-
-void refresh_recent_files()
-{
-#ifdef _WIN32_WCE
-       u32 count = gf_cfg_get_key_count(user.config, "RecentFiles");
-
-    HMENU hMenu = (HMENU)SendMessage(g_hwnd_menu, SHCMBM_GETSUBMENU, 0, ID_MENU_FILE);
-       /*pos is hardcoded*/
-       hMenu = GetSubMenu(hMenu, 2);
-
-       while (RemoveMenu(hMenu, 0, MF_BYPOSITION)) {}
-
-       for (u32 i=0; i<count; i++) {
-               TCHAR txt[100];
-               char *name;
-               const char *sOpt = gf_cfg_get_key_name(user.config, "RecentFiles", i);
-               name = strrchr(sOpt, '\\');
-               if (!name) name = strrchr(sOpt, '/');
-               if (!name) name = (char *) sOpt;
-               else name += 1;
-
-               CE_CharToWide(name, (u16 *) txt);
-               AppendMenu(hMenu, MF_STRING, IDM_OPEN_FILE1+i, txt);
-       }
-#endif
-}
-
-
-void open_file(HWND hwnd)
-{
-       Bool res;
-       char ext_list[4096];
-       strcpy(ext_list, "");
-
-       gf_freeze_display(1);
-
-       u32 count = gf_cfg_get_key_count(user.config, "MimeTypes");
-       for (u32 i=0; i<count; i++) {
-               char szKeyList[1000], *sKey;
-               const char *sMime = gf_cfg_get_key_name(user.config, "MimeTypes", i);
-               const char *opt = gf_cfg_get_key(user.config, "MimeTypes", sMime);
-               strcpy(szKeyList, opt+1);
-               sKey = strrchr(szKeyList, '\"');
-               if (!sKey) continue;
-               sKey[0] = 0;
-               strcat(ext_list, szKeyList);
-               strcat(ext_list, " ");
-       }
-#ifdef _WIN32_WCE
-       res = gf_file_dialog(g_hinst, hwnd, the_url, ext_list, user.config);
-#else
-       res = 0;
-#endif
-       gf_freeze_display(0);
-
-       /*let's go*/
-       if (res) do_open_file();
-}
-
-void load_recent_file(u32 idx)
-{
-       const char *sOpt = gf_cfg_get_key_name(user.config, "RecentFiles", idx);
-       if (sOpt) {
-               strcpy(the_url, sOpt);
-               do_open_file();
-       }
-}
-
-BOOL CALLBACK AboutDialogProc(const HWND hWnd, const UINT Msg, const WPARAM wParam, const LPARAM lParam) 
-{
-       BOOL ret = TRUE;
-    switch (Msg) {
-    case WM_INITDIALOG:
-       {
-               char szText[4096];
-               HWND hctl = GetDlgItem(hWnd, IDC_NAMECTRL);
-               sprintf(szText, "GPAC/Osmo4\nversion %s", GPAC_FULL_VERSION);
-#ifdef _WIN32_WCE
-           TCHAR           psz[80];
-               ZeroMemory(psz, sizeof(psz));
-               SHINITDLGINFO sid;
-               ZeroMemory(&sid, sizeof(sid));
-               sid.dwMask  = SHIDIM_FLAGS;
-               sid.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
-               sid.hDlg    = hWnd;
-               SHInitDialog(&sid);
-
-               SHMENUBARINFO mbi;
-               memset(&mbi, 0, sizeof(SHMENUBARINFO));
-               mbi.cbSize = sizeof(SHMENUBARINFO);
-               mbi.hwndParent = hWnd;
-               mbi.nToolBarId = IDR_ABOUT_MENU;
-               mbi.hInstRes = g_hinst;
-               mbi.nBmpId = 0;
-               mbi.cBmpImages = 0;     
-               SHCreateMenuBar(&mbi);
-
-               u16 swText[4096];
-               CE_CharToWide(szText, swText);
-
-               SetWindowText(hctl, (LPCWSTR) swText);
-#else
-               SetWindowText(hctl, szText);
-#endif
-               MoveWindow(hctl, 0, 0, screen_w, 40, 1);
-               MoveWindow(hWnd, 0, 0, screen_w, disp_w, 1);
-
-       }
-        break;
-    case WM_COMMAND:
-    case WM_CLOSE:
-               EndDialog(hWnd, 0);
-               break;
-       default:
-               ret = FALSE;
-       }
-       return ret;
-}
-void view_about(HWND hwnd)
-{
-       gf_freeze_display(1);
-//     ::ShowWindow(g_hwnd_mb, SW_HIDE);
-       int iResult = DialogBox(g_hinst, MAKEINTRESOURCE(IDD_APPABOUT), hwnd,(DLGPROC)AboutDialogProc);
-//     ::ShowWindow(g_hwnd_mb, SW_SHOW);
-       gf_freeze_display(0);
-}
-
-void pause_file()
-{
-       if (!is_connected) return;
-#ifdef _WIN32_WCE
-       TBBUTTONINFO tbbi; 
-       tbbi.cbSize = sizeof(tbbi); 
-       tbbi.dwMask = TBIF_TEXT; 
-#endif
-
-       if (gf_term_get_option(term, GF_OPT_PLAY_STATE)==GF_STATE_PLAYING) {
-               gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED);
-#ifdef _WIN32_WCE
-               tbbi.pszText = _T("Resume"); 
-#endif
-       } else {
-               gf_term_set_option(term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING);
-#ifdef _WIN32_WCE
-               tbbi.pszText = _T("Pause"); 
-#endif
-       }
-#ifdef _WIN32_WCE
-       SendMessage(g_hwnd_menu, TB_SETBUTTONINFO, IDM_FILE_PAUSE, (LPARAM)&tbbi); 
-#endif
-}
-
-void set_svg_progressive()
-{
-       use_svg_prog = !use_svg_prog;
-       if (use_svg_prog) {
-               gf_cfg_set_key(user.config, "SAXLoader", "Progressive", "yes");
-               gf_cfg_set_key(user.config, "SAXLoader", "MaxDuration", "30");
-       } else {
-               gf_cfg_set_key(user.config, "SAXLoader", "MaxDuration", "0");
-               gf_cfg_set_key(user.config, "SAXLoader", "Progressive", "no");
-       }
-}
-
-void set_gx_mode(u32 mode)
-{
-       char *opt;
-       switch (mode) {
-       case 0:
-               opt = "raw";
-               break;
-       case 1:
-               opt = "gx";
-               break;
-       case 2:
-               opt = "gdi";
-               break;
-       }
-       gf_cfg_set_key(user.config, "GAPI", "FBAccess", opt);
-
-//     gf_term_del(term);
-//     term = gf_term_new(&user);
-//     gf_term_disconnect(term);
-//     gf_term_connect(term, the_url);
-       do_layout(1);
-}
-
-void do_copy_paste()
-{
-       if (!OpenClipboard(g_hwnd)) return;
-
-       /*or we are editing text and clipboard is not empty*/
-       if (IsClipboardFormatAvailable(CF_TEXT) && (gf_term_paste_text(term, NULL, 1)==GF_OK)) {
-               HGLOBAL hglbCopy = GetClipboardData(CF_TEXT);
-               if (hglbCopy) {
-#ifdef _WIN32_WCE
-                       char szString[1024];
-                       LPCTSTR paste_string = (LPCTSTR) GlobalLock(hglbCopy);
-                       CE_WideToChar((u16 *) paste_string, szString);
-                       gf_term_paste_text(term, szString, 0);
-#else
-                       char *szString = (char *)GlobalLock(hglbCopy);
-                       gf_term_paste_text(term, szString, 0);
-#endif
-                       GlobalUnlock(hglbCopy); 
-               }
-       }
-       /*we have something to copy*/
-       else if (gf_term_get_text_selection(term, 1)!=NULL) {
-               u32 len;
-               const char *text = gf_term_get_text_selection(term, 0);
-               if (text && strlen(text)) {
-                       EmptyClipboard();
-                       len = strlen(text);
-
-#ifdef _WIN32_WCE
-                       HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(u16)); 
-                       LPCTSTR new_string = (LPCTSTR) GlobalLock(hglbCopy);
-                       CE_CharToWide((char*)text, (u16*)new_string); 
-#else
-                       HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(u8)); 
-                       char *new_string = (char*) GlobalLock(hglbCopy);
-                       strcpy(new_string, text); 
-#endif
-                       GlobalUnlock(hglbCopy); 
-                       SetClipboardData(CF_TEXT, hglbCopy);
-               }
-       }
-       CloseClipboard(); 
-}
-
-static void rewrite_log_tools(const char *lt) 
-{
-       char *opt = (char *) gf_cfg_get_key(user.config, "General", "LogTools");
-       if (!opt || !strcmp(opt, "none")) opt="";
-
-       if (!strstr(opt, lt)) {
-               char *opt2 = (char*) gf_malloc(sizeof(char) * (strlen(opt) + strlen(lt) + 2));
-               strcpy(opt2, opt);
-               if (strlen(opt)) strcat(opt2, ":");
-               strcat(opt2, lt);
-               gf_cfg_set_key(user.config, "General", "LogTools", opt2);
-               gf_free(opt2);
-       } else {
-               char *opt2, *sep;
-               opt2 = gf_strdup(opt);
-               opt2[0] = 0; 
-               
-               while (opt) {
-                       sep = strchr(opt, ':');
-                       if (sep) sep[0] = 0;
-                       if (strcmp(opt, lt)) {
-                               if (strlen(opt2)) strcat(opt2, ":");
-                               strcat(opt2, opt);
-                       }
-                       if (sep) sep[0] = ':';
-                       opt = sep ? sep+1 : NULL;;
-               }
-               if (!strlen(opt2)) strcpy(opt2, "none");
-               gf_cfg_set_key(user.config, "General", "LogTools", opt2);
-               gf_free(opt2);
-       }
-       setup_logs();
-}
-
-BOOL HandleCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
-{
-       switch (LOWORD(wParam)) {
-       case IDM_FILE_OPEN:
-               open_file(hwnd);
-               break;
-       case IDM_FILE_LOG_RTI:
-               log_rti = !log_rti;
-               setup_logs();
-               break;
-       case IDM_FILE_PAUSE:
-               pause_file();
-               break;
-       case IDM_VIEW_ABOUT:
-               view_about(hwnd);
-               break;
-       case IDM_VIEW_FS:
-               set_full_screen();
-               break;
-       case IDM_VIEW_STATUS:
-               show_status = !show_status;
-               gf_cfg_set_key(user.config, "General", "ShowStatusBar", show_status ? "yes" : "no");
-               do_layout(1);
-               break;
-       case IDM_VIEW_CPU:
-               view_cpu = !view_cpu;
-               break;
-       case IDM_VIEW_FORCEGL:
-               force_2d_gl = !force_2d_gl;
-               gf_cfg_set_key(user.config, "Compositor", "ForceOpenGL", force_2d_gl ? "yes" : "no");
-               gf_term_set_option(term, GF_OPT_USE_OPENGL, force_2d_gl);
-               break;
-       case IDM_NAV_RESET:
-               gf_term_set_option(term, GF_OPT_NAVIGATION_TYPE, 0);
-               break;
-       case IDM_NAV_NONE:
-               gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_NONE);
-               break;
-       case IDM_NAV_SLIDE:
-               gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_SLIDE);
-               break;
-       case IDM_NAV_WALK:
-               gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_WALK);
-               break;
-       case IDM_NAV_FLY:
-               gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_FLY);
-               break;
-       case IDM_NAV_EXAMINE:
-               gf_term_set_option(term, GF_OPT_NAVIGATION, GF_NAVIGATE_EXAMINE);
-               break;
-       case IDM_NAV_HEADLIGHT:
-               gf_term_set_option(term, GF_OPT_HEADLIGHT, !gf_term_get_option(term, GF_OPT_HEADLIGHT) );
-               break;
-       case IDM_NAV_COL_NONE:
-               gf_term_set_option(term, GF_OPT_COLLISION, GF_COLLISION_NONE);
-               break;
-       case IDM_NAV_COL_REG:
-               gf_term_set_option(term, GF_OPT_COLLISION, GF_COLLISION_NORMAL);
-               break;
-       case IDM_NAV_COL_DISP:
-               gf_term_set_option(term, GF_OPT_COLLISION, GF_COLLISION_DISPLACEMENT);
-               break;
-       case IDM_NAV_GRAVITY:
-               gf_term_set_option(term, GF_OPT_GRAVITY, !gf_term_get_option(term, GF_OPT_GRAVITY));
-               break;
-
-       case IDM_VIEW_AR_NONE:
-               gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_KEEP);
-               break;
-       case IDM_VIEW_AR_FILL:
-               gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_FILL_SCREEN);
-               break;
-       case IDM_VIEW_AR_4_3:
-               gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_4_3);
-               break;
-       case IDM_VIEW_AR_16_9:
-               gf_term_set_option(term, GF_OPT_ASPECT_RATIO, GF_ASPECT_RATIO_16_9);
-               break;
-
-       case IDM_VIEW_LOW_RATE:
-               use_low_fps = !use_low_fps;
-               gf_term_set_simulation_frame_rate(term, use_low_fps ? 15.0 : 30.0);
-               break;
-       case ID_VIDEO_DIRECTDRAW:
-       {
-               u32 drend = (gf_term_get_option(term, GF_OPT_DRAW_MODE)==GF_DRAW_MODE_IMMEDIATE) ? GF_DRAW_MODE_DEFER : GF_DRAW_MODE_IMMEDIATE;
-               gf_term_set_option(term, GF_OPT_DRAW_MODE, drend);
-               gf_cfg_set_key(user.config, "Compositor", "DrawMode", drend ? "immediate" : "defer");
-       }
-               break;
-
-       case ID_FILE_CUT_PASTE:
-               do_copy_paste();
-               break;
-
-       case IDM_OPEN_FILE1: 
-       case IDM_OPEN_FILE2: 
-       case IDM_OPEN_FILE3: 
-       case IDM_OPEN_FILE4: 
-       case IDM_OPEN_FILE5: 
-       case IDM_OPEN_FILE6: 
-       case IDM_OPEN_FILE7: 
-       case IDM_OPEN_FILE8: 
-       case IDM_OPEN_FILE9: 
-       case IDM_OPEN_FILE10: 
-               load_recent_file(LOWORD(wParam) - IDM_OPEN_FILE1); 
-               break;
-
-       case IDS_CAP_DISABLE_PLAYLIST:
-               playlist_navigation_on = !playlist_navigation_on;
-               break;
-       case IDM_VIEW_SVG_LOAD:
-               set_svg_progressive();
-               break;
-       case ID_VIDEO_DIRECTFB:
-               set_gx_mode(0);
-               break;
-       case ID_VIDEO_GAPI:
-               set_gx_mode(1);
-               break;
-       case ID_VIDEO_GDI:
-               set_gx_mode(2);
-               break;
-
-       case ID_LOGLEVEL_NONE:
-               gf_cfg_set_key(user.config, "General", "LogLevel", "none");
-               setup_logs();
-               break;
-       case ID_LOGLEVEL_ERROR:
-               gf_cfg_set_key(user.config, "General", "LogLevel", "error");
-               setup_logs();
-               break;
-       case ID_LOGLEVEL_WARNING:
-               gf_cfg_set_key(user.config, "General", "LogLevel", "warning");
-               setup_logs();
-               break;
-       case ID_LOGLEVEL_INFO:
-               gf_cfg_set_key(user.config, "General", "LogLevel", "info");
-               setup_logs();
-               break;
-       case ID_LOGLEVEL_DEBUG:
-               gf_cfg_set_key(user.config, "General", "LogLevel", "debug");
-               setup_logs();
-               break;
-       case ID_TOOLS_CORE: rewrite_log_tools("core"); break;
-       case ID_TOOLS_CODING: rewrite_log_tools("coding"); break;
-       case ID_TOOLS_CONTAINER: rewrite_log_tools("container"); break;
-       case ID_TOOLS_NETWORK: rewrite_log_tools("network"); break;
-       case ID_TOOLS_RTP: rewrite_log_tools("rtp"); break;
-       case ID_TOOLS_SCRIPT: rewrite_log_tools("script"); break;
-       case ID_TOOLS_CODEC: rewrite_log_tools("codec"); break;
-       case ID_TOOLS_PARSER: rewrite_log_tools("parser"); break;
-       case ID_TOOLS_MEDIA: rewrite_log_tools("media"); break;
-       case ID_TOOLS_SCENE: rewrite_log_tools("scene"); break;
-       case ID_TOOLS_INTERACT: rewrite_log_tools("interact"); break;
-       case ID_TOOLS_COMPOSE: rewrite_log_tools("compose"); break;
-       case ID_TOOLS_MMIO: rewrite_log_tools("mmio"); break;
-       case ID_TOOLS_RTI: rewrite_log_tools("rti"); break;
-       case ID_TOOLS_ALL: 
-               gf_cfg_set_key(user.config, "General", "LogTools", "all");
-               setup_logs();
-               break;
-       case ID_TOOLS_NONE: 
-               gf_cfg_set_key(user.config, "General", "LogTools", "none");
-               setup_logs();
-               break;
-       case ID_LOGS_RESET: 
-               if (log_file) {
-                       fclose(log_file);
-                       log_file = NULL;
-               }
-               gf_delete_file("\\gpac_logs.txt");
-               setup_logs();
-               break;
-
-       case IDM_ITEM_QUIT:
-               DestroyWindow(hwnd);
-               return FALSE;
-       }
-       return TRUE;
-}
-
-static BOOL OnMenuPopup(const HWND hWnd, const WPARAM wParam)
-{
-       char *opt;
-       u32 type;
-       CheckMenuItem((HMENU)wParam, IDM_VIEW_STATUS, MF_BYCOMMAND| (show_status ? MF_CHECKED : MF_UNCHECKED) );
-       CheckMenuItem((HMENU)wParam, IDM_VIEW_FORCEGL, MF_BYCOMMAND| (force_2d_gl ? MF_CHECKED : MF_UNCHECKED) );
-       EnableMenuItem((HMENU)wParam, IDM_VIEW_CPU, MF_BYCOMMAND| (show_status ? MF_ENABLED : MF_GRAYED) );
-       if (show_status) CheckMenuItem((HMENU)wParam, IDM_VIEW_CPU, MF_BYCOMMAND| (view_cpu ? MF_CHECKED : MF_UNCHECKED) );
-       CheckMenuItem((HMENU)wParam, IDM_VIEW_LOW_RATE, MF_BYCOMMAND| (use_low_fps ? MF_CHECKED : MF_UNCHECKED) );
-
-       EnableMenuItem((HMENU)wParam, ID_VIDEO_DIRECTDRAW, MF_BYCOMMAND| (!force_2d_gl ? MF_ENABLED : MF_GRAYED) );
-       CheckMenuItem((HMENU)wParam, ID_VIDEO_DIRECTDRAW, MF_BYCOMMAND| (!force_2d_gl && gf_term_get_option(term, GF_OPT_DRAW_MODE) ? MF_CHECKED : MF_UNCHECKED) );
-
-       CheckMenuItem((HMENU)wParam, IDM_VIEW_SVG_LOAD, MF_BYCOMMAND| (use_svg_prog ? MF_CHECKED : MF_UNCHECKED) );
-
-       opt = (char *)gf_cfg_get_key(user.config, "GAPI", "FBAccess"); 
-       if (!opt) opt = "raw";
-       CheckMenuItem((HMENU)wParam, ID_VIDEO_DIRECTFB, MF_BYCOMMAND| ( (!strcmp(opt,"raw")) ? MF_CHECKED : MF_UNCHECKED) );
-       CheckMenuItem((HMENU)wParam, ID_VIDEO_GAPI, MF_BYCOMMAND| ( (!strcmp(opt,"gx")) ? MF_CHECKED : MF_UNCHECKED) );
-       CheckMenuItem((HMENU)wParam, ID_VIDEO_GDI, MF_BYCOMMAND| ( (!strcmp(opt,"gdi")) ? MF_CHECKED : MF_UNCHECKED) );
-
-
-       type = gf_term_get_option(term, GF_OPT_ASPECT_RATIO);   
-       CheckMenuItem((HMENU)wParam, IDS_CAP_DISABLE_PLAYLIST, MF_BYCOMMAND| (!playlist_navigation_on ? MF_CHECKED : MF_UNCHECKED) );
-       CheckMenuItem((HMENU)wParam, IDM_VIEW_AR_NONE, MF_BYCOMMAND| (type==GF_ASPECT_RATIO_KEEP) ? MF_CHECKED : MF_UNCHECKED);
-       CheckMenuItem((HMENU)wParam, IDM_VIEW_AR_FILL, MF_BYCOMMAND| (type==GF_ASPECT_RATIO_FILL_SCREEN) ? MF_CHECKED : MF_UNCHECKED);
-       CheckMenuItem((HMENU)wParam, IDM_VIEW_AR_4_3, MF_BYCOMMAND| (type==GF_ASPECT_RATIO_4_3) ? MF_CHECKED : MF_UNCHECKED);
-       CheckMenuItem((HMENU)wParam, IDM_VIEW_AR_16_9, MF_BYCOMMAND| (type==GF_ASPECT_RATIO_16_9) ? MF_CHECKED : MF_UNCHECKED);
-
-       EnableMenuItem((HMENU)wParam, IDM_FILE_PAUSE, MF_BYCOMMAND| (is_connected ? MF_ENABLED : MF_GRAYED) );
-
-       if (/*we have something to copy*/
-               (gf_term_get_text_selection(term, 1)!=NULL) 
-               /*or we are editing text and clipboard is not empty*/
-               || (IsClipboardFormatAvailable(CF_TEXT) && (gf_term_paste_text(term, NULL, 1)==GF_OK))
-       ) {
-               EnableMenuItem((HMENU)wParam, ID_FILE_CUT_PASTE, MF_BYCOMMAND| MF_ENABLED);
-       } else {
-               EnableMenuItem((HMENU)wParam, ID_FILE_CUT_PASTE, MF_BYCOMMAND| MF_GRAYED);
-       }
-       
-       CheckMenuItem((HMENU)wParam, IDM_FILE_LOG_RTI, MF_BYCOMMAND| (log_rti) ? MF_CHECKED : MF_UNCHECKED);
-       
-       if (!is_connected) type = 0;
-       else type = gf_term_get_option(term, GF_OPT_NAVIGATION_TYPE);
-       navigation_on = type ? 1 : 0;
-
-       EnableMenuItem((HMENU)wParam, IDM_NAV_NONE, MF_BYCOMMAND | (!type ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem((HMENU)wParam, IDM_NAV_SLIDE, MF_BYCOMMAND | (!type ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem((HMENU)wParam, IDM_NAV_RESET, MF_BYCOMMAND | (!type ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem((HMENU)wParam, IDM_NAV_WALK, MF_BYCOMMAND | ( (type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem((HMENU)wParam, IDM_NAV_FLY, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem((HMENU)wParam, IDM_NAV_EXAMINE, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem((HMENU)wParam, IDM_NAV_COL_NONE, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem((HMENU)wParam, IDM_NAV_COL_REG, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem((HMENU)wParam, IDM_NAV_COL_DISP, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem((HMENU)wParam, IDM_NAV_GRAVITY, MF_BYCOMMAND | ((type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-       EnableMenuItem((HMENU)wParam, IDM_NAV_HEADLIGHT, MF_BYCOMMAND | ( (type!=GF_NAVIGATE_TYPE_3D) ? MF_GRAYED : MF_ENABLED) );
-
-       if (type) {
-               u32 mode = gf_term_get_option(term, GF_OPT_NAVIGATION);
-               navigation_on = (mode==GF_NAVIGATE_NONE) ? 0 : 1;
-               CheckMenuItem((HMENU)wParam, IDM_NAV_NONE, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_NONE) ? MF_CHECKED : MF_UNCHECKED) );
-               CheckMenuItem((HMENU)wParam, IDM_NAV_SLIDE, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_SLIDE) ? MF_CHECKED : MF_UNCHECKED) );
-               CheckMenuItem((HMENU)wParam, IDM_NAV_WALK, MF_BYCOMMAND | ( (mode==GF_NAVIGATE_WALK) ? MF_CHECKED : MF_UNCHECKED) );
-               CheckMenuItem((HMENU)wParam, IDM_NAV_FLY, MF_BYCOMMAND | ((mode==GF_NAVIGATE_FLY) ? MF_CHECKED : MF_UNCHECKED) );
-               CheckMenuItem((HMENU)wParam, IDM_NAV_EXAMINE, MF_BYCOMMAND | ((mode==GF_NAVIGATE_EXAMINE) ? MF_CHECKED : MF_UNCHECKED) );
-
-               if (type==GF_NAVIGATE_TYPE_3D) {
-                       CheckMenuItem((HMENU)wParam, IDM_NAV_HEADLIGHT, MF_BYCOMMAND | ( gf_term_get_option(term, GF_OPT_HEADLIGHT) ? MF_CHECKED : MF_UNCHECKED) );
-                       CheckMenuItem((HMENU)wParam, IDM_NAV_GRAVITY, MF_BYCOMMAND | ( gf_term_get_option(term, GF_OPT_GRAVITY) ? MF_CHECKED : MF_UNCHECKED) );
-                       type = gf_term_get_option(term, GF_OPT_COLLISION);
-                       CheckMenuItem((HMENU)wParam, IDM_NAV_COL_NONE, MF_BYCOMMAND | ( (type==GF_COLLISION_NONE) ? MF_CHECKED : MF_UNCHECKED) );
-                       CheckMenuItem((HMENU)wParam, IDM_NAV_COL_REG, MF_BYCOMMAND | ( (type==GF_COLLISION_NORMAL) ? MF_CHECKED : MF_UNCHECKED) );
-                       CheckMenuItem((HMENU)wParam, IDM_NAV_COL_DISP, MF_BYCOMMAND | ( (type==GF_COLLISION_DISPLACEMENT) ? MF_CHECKED : MF_UNCHECKED) );
-               }
-       }
-
-       opt = (char *) gf_cfg_get_key(user.config, "General", "LogLevel");
-       CheckMenuItem((HMENU)wParam, ID_LOGLEVEL_NONE, MF_BYCOMMAND | ( !strcmp(opt, "none") ? MF_CHECKED : MF_UNCHECKED) );
-       CheckMenuItem((HMENU)wParam, ID_LOGLEVEL_ERROR, MF_BYCOMMAND | ( !strcmp(opt, "error") ? MF_CHECKED : MF_UNCHECKED) );
-       CheckMenuItem((HMENU)wParam, ID_LOGLEVEL_WARNING, MF_BYCOMMAND | ( !strcmp(opt, "warning") ? MF_CHECKED : MF_UNCHECKED) );
-       CheckMenuItem((HMENU)wParam, ID_LOGLEVEL_INFO, MF_BYCOMMAND | ( !strcmp(opt, "info") ? MF_CHECKED : MF_UNCHECKED) );
-       CheckMenuItem((HMENU)wParam, ID_LOGLEVEL_DEBUG, MF_BYCOMMAND | ( !strcmp(opt, "debug") ? MF_CHECKED : MF_UNCHECKED) );
-
-#define CHECK_TOOL(_ID, _name) CheckMenuItem((HMENU)wParam, _ID, MF_BYCOMMAND | ( ((strstr(opt, _name) != NULL) || !strcmp(opt, "all")) ? MF_CHECKED : MF_UNCHECKED) );
-       opt = (char *) gf_cfg_get_key(user.config, "General", "LogTools");
-       CHECK_TOOL(ID_TOOLS_CORE, "core");
-       CHECK_TOOL(ID_TOOLS_CODING, "coding");
-       CHECK_TOOL(ID_TOOLS_CONTAINER, "container");
-       CHECK_TOOL(ID_TOOLS_NETWORK, "network");
-       CHECK_TOOL(ID_TOOLS_RTP, "rtp");
-       CHECK_TOOL(ID_TOOLS_SYNC, "sync");
-       CHECK_TOOL(ID_TOOLS_SCRIPT, "script");
-       CHECK_TOOL(ID_TOOLS_CODEC, "codec");
-       CHECK_TOOL(ID_TOOLS_PARSER, "parser");
-       CHECK_TOOL(ID_TOOLS_MEDIA, "media");
-       CHECK_TOOL(ID_TOOLS_SCENE, "scene");
-       CHECK_TOOL(ID_TOOLS_INTERACT, "interact");
-       CHECK_TOOL(ID_TOOLS_COMPOSE, "compose");
-       CHECK_TOOL(ID_TOOLS_MMIO, "mmio");
-       CHECK_TOOL(ID_TOOLS_RTI, "rti");
-
-
-    return TRUE;
-}
-
-
-BOOL CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
-       switch (msg) {
-       case WM_CREATE:
-       {
-#ifdef _WIN32_WCE
-               SHMENUBARINFO mbi;
-               memset(&mbi, 0, sizeof(SHMENUBARINFO));
-               mbi.cbSize = sizeof(SHMENUBARINFO);
-               mbi.hwndParent = hwnd;
-               mbi.hInstRes = g_hinst;
-               mbi.nBmpId = 0;
-               mbi.cBmpImages = 0;     
-               
-               mbi.nToolBarId = IDM_MAIN_MENU;
-               SHCreateMenuBar(&mbi);
-               g_hwnd_menu = mbi.hwndMB;
-#else
-               g_hwnd_menu = NULL;
-#endif
-
-               g_hwnd_status = CreateWindow(TEXT("STATIC"), TEXT("Status"), WS_CHILD|WS_VISIBLE|SS_LEFT, 0, 0, disp_w, caption_h, hwnd, NULL, g_hinst, NULL);
-
-               do_layout(1);
-       }
-               break;
-               
-       case WM_COMMAND:
-               if (HandleCommand(hwnd, wParam, lParam))
-                       return DefWindowProc(hwnd, msg, wParam, lParam);
-               break;
-       case WM_TIMER:
-               if (wParam==STATE_TIMER_ID) update_state_info();
-#ifdef TERM_NOT_THREADED
-               else gf_term_process_step(term);
-#endif
-               break;
-       case WM_HOTKEY:
-               break;
-       case WM_KEYDOWN:
-               if (playlist_navigation_on && !navigation_on) {
-                       if (wParam==VK_LEFT) { switch_playlist(1); break; }
-                       else if (wParam==VK_RIGHT) { switch_playlist(0); break; }
-               }
-               /*fall through*/
-       case WM_SYSKEYDOWN:
-       case WM_SYSKEYUP:
-       case WM_KEYUP:
-       case WM_CHAR:
-       case WM_MOUSEMOVE:
-       case WM_LBUTTONDOWN:
-       case WM_LBUTTONDBLCLK:
-       case WM_LBUTTONUP:
-               ::SendMessage(g_hwnd_disp, msg, wParam, lParam);
-               return 0;
-    case WM_INITMENUPOPUP:
-        OnMenuPopup(hwnd, wParam);
-        break;
-       case WM_CLOSE:
-               DestroyWindow(hwnd);
-               break;
-    case WM_SETFOCUS:
-               gf_freeze_display(0);
-               break;
-    case WM_KILLFOCUS:
-        if ((HWND) wParam==g_hwnd) {
-                       gf_freeze_display(1);
-               }
-               break;
-    case WM_ACTIVATE:
-        if (WA_INACTIVE != LOWORD(wParam)) {
-                       if ((HWND) lParam == g_hwnd) {
-                               gf_freeze_display(0);
-                               SetFocus(hwnd);
-                       }
-               } else {
-                       if ((HWND) lParam == g_hwnd_disp) {
-                               gf_freeze_display(1);
-                       }
-               }
-        break;
-       case WM_LOADTERM:
-               if (!LoadTerminal()) {
-                       MessageBox(hwnd, _T("Cannot load GPAC"), _T("Error"), MB_OK);
-                       PostQuitMessage(0);
-               }
-               break;
-       case WM_DESTROY:
-               PostQuitMessage(0);
-               break;
-       default:
-               return DefWindowProc(hwnd, msg, wParam, lParam);
-       }
-       
-       return 0;
-}
-
-BOOL InitInstance (int CmdShow)
-{
-       WNDCLASS wc;
-
-    wc.style                   = 0;
-    wc.lpfnWndProc             = (WNDPROC) MainWndProc;
-    wc.cbClsExtra              = 0;
-    wc.cbWndExtra              = 0;
-    wc.hInstance               = g_hinst;
-    wc.hIcon                   = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON));
-    wc.hCursor                 = 0;
-    wc.hbrBackground   = (HBRUSH) GetStockObject(WHITE_BRUSH);
-    wc.lpszMenuName            = 0;
-    wc.lpszClassName   = _T("Osmophone");
-       RegisterClass(&wc);
-
-#ifdef _WIN32_WCE
-       int style = WS_VISIBLE;
-#else
-       int style = WS_POPUP;
-#endif
-
-       g_hwnd = CreateWindow(_T("Osmophone"), _T("Osmophone"), 
-                                                 style,
-                                                 0, caption_h, disp_w, disp_h, 
-                                                 NULL, NULL, g_hinst, NULL);
-       
-       if (!g_hwnd) return FALSE;
-
-       ShowWindow(g_hwnd, CmdShow);
-
-       refresh_recent_files();
-
-       ::SetTimer(g_hwnd, STATE_TIMER_ID, STATE_TIMER_DUR, NULL);
-       do_layout(1);
-
-       set_status("Loading Terminal");
-       PostMessage(g_hwnd, WM_LOADTERM, 0, 0);
-       set_status("Ready");
-       return TRUE;
-}
-
-#ifndef GETRAWFRAMEBUFFER
-    #define GETRAWFRAMEBUFFER   0x00020001
-    typedef struct _RawFrameBufferInfo
-    {
-           WORD wFormat;
-           WORD wBPP;
-           VOID *pFramePointer;
-           int cxStride;
-           int cyStride;
-        int cxPixels;
-        int cyPixels;
-    } RawFrameBufferInfo;
-
-    #define FORMAT_565 1
-    #define FORMAT_555 2
-    #define FORMAT_OTHER 3
-#endif
-
-int WINAPI WinMain(HINSTANCE hInstance, 
-                                  HINSTANCE hPrevInstance, 
-#ifdef _WIN32_WCE
-                                  LPWSTR lpCmdLine, 
-#else
-                                  LPSTR lpCmdLine, 
-#endif
-                                  int nShowCmd 
-) {
-       MSG     msg;
-#ifdef _WIN32_WCE
-       TCHAR wzExePath[GF_MAX_PATH];
-#endif
-
-       HWND    hwndOld = NULL; 
-       const char *str;
-       Bool initial_launch = 0;
-
-       if (hwndOld = FindWindow(_T("Osmophone"), NULL))
-       {
-               SetForegroundWindow(hwndOld);    
-               return 0;
-       }
-       
-       memset(&user, 0, sizeof(GF_User));
-       term = NULL;
-
-       g_hinst = hInstance;
-       
-       screen_w = GetSystemMetrics(SM_CXSCREEN);
-       screen_h = GetSystemMetrics(SM_CYSCREEN);
-
-       /*are we in low res or high res*/
-       RawFrameBufferInfo Info;
-       HDC DC = GetDC(NULL);
-       ExtEscape(DC, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char*)&Info);
-       ReleaseDC(NULL,DC);
-       if (Info.pFramePointer) {
-               recompute_res(Info.cxPixels, Info.cyPixels);
-       } else {
-               recompute_res(screen_w, screen_h);
-       }
-
-
-
-#ifdef _WIN32_WCE
-       TCHAR      szBuf[MAX_PATH];
-       SystemParametersInfo(SPI_GETPLATFORMTYPE, MAX_PATH, szBuf, 0);
-       if (! lstrcmp(szBuf, __TEXT("PocketPC"))) is_ppc = 1;
-       else if (! lstrcmp(szBuf, __TEXT("Palm PC2"))) is_ppc = 1;
-#endif
-
-
-       user.config = gf_cfg_init(NULL, &initial_launch);
-       if (!user.config) {
-               MessageBox(NULL, _T("Couldn't locate GPAC config file"), _T("Fatal Error"), MB_OK);
-               return 0;
-       }
-
-    str = gf_cfg_get_key(user.config, "Compositor", "ScreenWidth");
-       if (str) screen_w = atoi(str);
-    str = gf_cfg_get_key(user.config, "Compositor", "ScreenHeight");
-       if (str) screen_h = atoi(str);
-       disp_w = screen_w;
-#ifdef _WIN32_WCE
-       disp_h = screen_h - menu_h /*- caption_h*/;
-#else
-       disp_h = screen_h;
-#endif
-
-       str = gf_cfg_get_key(user.config, "General", "ModulesDirectory");
-       if (!str) {
-               gf_cfg_del(user.config);
-               MessageBox(NULL, _T("Couldn't locate GPAC plugins"), _T("Fatal Error"), MB_OK);
-               return 0;
-       }
-
-       gf_sys_init(0);
-       user.modules = gf_modules_new(str, user.config);
-       if (!gf_modules_get_count(user.modules)) {
-               MessageBox(GetForegroundWindow(), _T("No modules found"), _T("GPAC Init Error"), MB_OK);
-               gf_modules_del(user.modules);
-               gf_cfg_del(user.config);
-               memset(&user, 0, sizeof(GF_User));
-               gf_sys_close();
-               return 0;
-       }
-
-       /*first launch, register all files ext*/
-       if (initial_launch) {
-               /*FFMPEG registration - FFMPEG DLLs compiled with CEGCC cannot be loaded directly under WM 6.1
-               cf http://cegcc.sourceforge.net/docs/faq.html#DllDoesNotWorkWithWindowsMobile6.1
-               */
-               HKEY hKey = NULL;
-               DWORD dwSize;
-               DWORD dwValue;
-               RegCreateKeyEx(HKEY_LOCAL_MACHINE, _T("System\\Loader\\LoadModuleLow"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dwSize);
-               dwSize = 4; dwValue = 1;
-               LONG res = RegSetValueEx(hKey, _T("avcodec-52.dll"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
-               res = RegSetValueEx(hKey, _T("avformat-52.dll"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
-               res = RegSetValueEx(hKey, _T("avutil-50.dll"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
-               res = RegSetValueEx(hKey, _T("swscale-0.dll"), NULL, REG_DWORD, (unsigned char *)&dwValue, dwSize);
-               RegCloseKey(hKey);
-
-               u32 i;
-               for (i=0; i<gf_modules_get_count(user.modules); i++) {
-                       GF_InputService *ifce = (GF_InputService *) gf_modules_load_interface(user.modules, i, GF_NET_CLIENT_INTERFACE);
-                       if (!ifce) continue;
-                       if (ifce) {
-                               ifce->CanHandleURL(ifce, "test.test");
-                               gf_modules_close_interface((GF_BaseInterface *)ifce);
-                       }
-               }
-               MessageBox(NULL, _T("Thank you for installing GPAC"), _T("Initial setup done"), MB_OK);
-       }
-
-       str = gf_cfg_get_key(user.config, "General", "Loop");
-       loop = (!str || !stricmp(str, "yes")) ? 1 : 0;
-
-       str = gf_cfg_get_key(user.config, "SAXLoader", "Progressive");
-       use_svg_prog = (str && !strcmp(str, "yes")) ? 1 : 0;
-
-       str = gf_cfg_get_key(user.config, "General", "RTIRefreshPeriod");
-       if (str) {
-               rti_update_time_ms = atoi(str);
-       } else {
-               gf_cfg_set_key(user.config, "General", "RTIRefreshPeriod", "200");
-       }
-
-       str = gf_cfg_get_key(user.config, "General", "ShowStatusBar");
-       show_status = (str && !strcmp(str, "yes")) ? 1 : 0;
-
-
-#ifdef _WIN32_WCE
-       if (is_ppc) GXOpenInput();
-#endif
-
-       if (InitInstance(nShowCmd)) {
-               SetForegroundWindow(g_hwnd);
-               show_taskbar(0);
-
-               force_2d_gl = gf_term_get_option(term, GF_OPT_USE_OPENGL);
-
-               while (GetMessage(&msg, NULL, 0,0) == TRUE) {
-                       TranslateMessage (&msg);
-                       DispatchMessage (&msg);
-
-                       if (playlist_act) {
-                               switch_playlist(playlist_act-1);
-                               playlist_act = 0;
-                       }
-               }
-               show_taskbar(1);
-       }
-#ifdef _WIN32_WCE
-       if (is_ppc) GXCloseInput();
-#endif
-
-       /*and destroy*/
-       if (term) gf_term_del(term);
-       if (user.modules) gf_modules_del(user.modules);
-       if (user.config) gf_cfg_del(user.config);
-
-       if (backlight_off) set_backlight_state(0);
-
-       gf_sys_close();
-       if (log_file) fclose(log_file);
-       return 0;
-}
diff --git a/applications/osmophone/newres.h b/applications/osmophone/newres.h
deleted file mode 100644 (file)
index f06a428..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef __NEWRES_H__
-#define __NEWRES_H__
-
-#if defined(_WIN32_WCE) && !defined(UNDER_CE)
-#define UNDER_CE _WIN32_WCE
-#endif
-
-#if defined(_WIN32_WCE)
-       #if !defined(WCEOLE_ENABLE_DIALOGEX)
-               #define DIALOGEX DIALOG DISCARDABLE
-       #endif
-       #include <commctrl.h>
-       #define  SHMENUBAR RCDATA
-       #if defined(WIN32_PLATFORM_PSPC) && (_WIN32_WCE >= 300)
-               #include <aygshell.h>
-               #define AFXCE_IDR_SCRATCH_SHMENU  28700
-       #else
-               #define I_IMAGENONE             (-2)
-               #define NOMENU                  0xFFFF
-               #define IDS_SHNEW               1
-
-               #define IDM_SHAREDNEW        10
-               #define IDM_SHAREDNEWDEFAULT 11
-       #endif // _WIN32_WCE_PSPC
-       #define AFXCE_IDD_SAVEMODIFIEDDLG 28701
-#endif // _WIN32_WCE
-
-#ifdef RC_INVOKED
-#ifndef _INC_WINDOWS
-#define _INC_WINDOWS
-       #include "winuser.h"           // extract from windows header
-       #include "winver.h"   
-#endif
-#endif
-
-#ifdef IDC_STATIC
-#undef IDC_STATIC
-#endif
-#define IDC_STATIC      (-1)
-
-#endif //__NEWRES_H__
diff --git a/applications/osmophone/openfile.cpp b/applications/osmophone/openfile.cpp
deleted file mode 100644 (file)
index 9716c98..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-#include <windows.h>
-
-#ifdef _WIN32_WCE
-
-#include <aygshell.h>
-
-#include <gpac/config_file.h>
-#include "resource.h"
-
-static HINSTANCE g_hInst = NULL;
-static HMENU g_hMenuView;
-static HWND g_hWndMenuBar;
-static HWND hDirTxt;
-static HWND the_wnd;
-static HWND hList;
-static TCHAR w_current_dir[GF_MAX_PATH] = _T("\\");
-static u8 current_dir[GF_MAX_PATH] = "\\";
-static const char *extension_list = NULL;
-static char *out_url = NULL;
-Bool bViewUnknownTypes = 0;
-Bool playlist_mode = 0;
-GF_Config *cfg;
-
-
-static void refresh_menu_states()
-{
-       if (playlist_mode) {
-               EnableMenuItem(g_hMenuView, IDM_OF_PL_UP, MF_BYCOMMAND|MF_ENABLED);
-               EnableMenuItem(g_hMenuView, IDM_OF_PL_DOWN, MF_BYCOMMAND|MF_ENABLED );
-       } else {
-               EnableMenuItem(g_hMenuView, IDM_OF_VIEW_ALL, MF_BYCOMMAND| (extension_list ? MF_ENABLED : MF_GRAYED) );
-               CheckMenuItem(g_hMenuView, IDM_OF_VIEW_ALL, MF_BYCOMMAND| (bViewUnknownTypes ? MF_CHECKED : MF_UNCHECKED) );
-       }
-       CheckMenuItem(g_hMenuView, IDM_OF_PLAYLIST, MF_BYCOMMAND| (playlist_mode ? MF_CHECKED : MF_UNCHECKED) );
-}
-
-static void switch_menu_pl()
-{
-       DeleteMenu(g_hMenuView, IDM_OF_VIEW_ALL, MF_BYCOMMAND);
-       DeleteMenu(g_hMenuView, IDM_OF_PL_UP, MF_BYCOMMAND);
-       DeleteMenu(g_hMenuView, IDM_OF_PL_DOWN, MF_BYCOMMAND);
-       DeleteMenu(g_hMenuView, IDM_OF_PL_CLEAR, MF_BYCOMMAND);
-       
-       if (playlist_mode) {
-               InsertMenu(g_hMenuView, 0, MF_BYPOSITION, IDM_OF_PL_CLEAR, _T("Clear"));
-               InsertMenu(g_hMenuView, 0, MF_BYPOSITION, IDM_OF_PL_DOWN, _T("Move Down") );
-               InsertMenu(g_hMenuView, 0, MF_BYPOSITION, IDM_OF_PL_UP, _T("Move Up") );
-       } else {
-               InsertMenu(g_hMenuView, 0, MF_BYPOSITION, IDM_OF_VIEW_ALL, _T("All Unknown Files") );
-       }
-       TBBUTTONINFO tbbi; 
-       tbbi.cbSize = sizeof(tbbi); 
-       tbbi.dwMask = TBIF_TEXT; 
-       tbbi.pszText = playlist_mode ? _T("Remove") : _T("Add"); 
-       SendMessage(g_hWndMenuBar, TB_SETBUTTONINFO, IDM_OF_PL_ACT, (LPARAM)&tbbi); 
-       refresh_menu_states();
-}
-
-
-Bool enum_dirs(void *cbk, char *name, char *path)
-{
-       TCHAR w_name[GF_MAX_PATH], w_str_name[GF_MAX_PATH];
-
-       CE_CharToWide(name, (u16 *) w_name);
-       wcscpy(w_str_name, _T("+ "));
-       wcscat(w_str_name, w_name);
-    int iRes = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR) w_str_name);
-       SendMessage(hList, LB_SETITEMDATA, iRes, (LPARAM) 1);
-       return 0;
-}
-
-Bool enum_files(void *cbk, char *name, char *path)
-{
-       TCHAR w_name[GF_MAX_PATH];
-
-       if (!bViewUnknownTypes && extension_list) {
-               char *ext = strrchr(name, '.');
-               if (!ext || !strstr(extension_list, ext+1)) return 0;
-       }
-       CE_CharToWide(name, (u16 *) w_name);
-    SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR) w_name);
-       return 0;
-}
-
-
-void set_directory(TCHAR *dir)
-{
-       SendMessage(hList, LB_RESETCONTENT, 0, 0);
-
-       CE_WideToChar((u16 *) dir, (char *) current_dir);
-       wcscpy(w_current_dir, dir);
-       SetWindowText(hDirTxt, w_current_dir);
-
-       if (strcmp((const char *) current_dir, "\\")) {
-               int iRes = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR) _T("+ ..") );
-               SendMessage(hList, LB_SETITEMDATA, iRes, (LPARAM) 1);
-       }
-
-       /*enum directories*/
-       gf_enum_directory((const char *) current_dir, 1, enum_dirs, NULL, NULL);
-       /*enum files*/
-       gf_enum_directory((char *) current_dir, 0, enum_files, NULL, NULL);
-    SendMessage(hList, LB_SETCURSEL, 0, 0);
-       SetFocus(hList);
-}
-
-
-
-void refresh_playlist()
-{
-       TCHAR w_name[GF_MAX_PATH];
-       u32 count, i;
-
-       SetWindowText(hDirTxt, _T("Playlist"));
-       SendMessage(hList, LB_RESETCONTENT, 0, 0);
-
-       count = gf_cfg_get_key_count(cfg, "Playlist");
-       for (i=0; i<count; i++) {
-               const char *file = gf_cfg_get_key_name(cfg, "Playlist", i);
-               char *name = strrchr(file, '\\');
-               if (!name) name = strrchr(file, '/');
-               CE_CharToWide(name ? name+1 : (char *) file, (u16 *) w_name);
-               SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR) w_name);
-       }
-       i = 0;
-       const char *ple = gf_cfg_get_key(cfg, "General", "PLEntry");
-       i = ple ? atoi(ple) : 0;
-       if (i>=count) i=0;
-    SendMessage(hList, LB_SETCURSEL, i, 0);
-       SetFocus(hList);
-}
-
-void playlist_act(u32 act_type)
-{
-       u32 idx, count;
-       char entry[MAX_PATH];
-       const char *url;
-
-       /*reset all*/
-       if (act_type == 3) {
-               count = gf_cfg_get_key_count(cfg, "Playlist");
-               while (count) {
-                       url = gf_cfg_get_key_name(cfg, "Playlist", 0);
-                       gf_cfg_set_key(cfg, "Playlist", url, NULL);
-                       count--;
-               }
-               refresh_playlist();
-               return;
-       }
-    count = SendMessage(hList, LB_GETSELCOUNT, 0, 0);
-       if (!count) return;
-    idx = SendMessage(hList, LB_GETCURSEL, 0, 0);
-
-       if ((act_type==1) && !idx) return;
-       else if ((act_type==2) && (idx+1==count)) return;
-
-       url = gf_cfg_get_key_name(cfg, "Playlist", idx);
-       if (!url) return;
-       strcpy(entry, url);
-       /*remove from playlist*/
-       gf_cfg_set_key(cfg, "Playlist", url, NULL);
-       switch (act_type) {
-       /*remove*/
-       case 0:
-               if (idx+1==count) idx--;
-               break;
-       /*up*/
-       case 1: 
-               gf_cfg_insert_key(cfg, "Playlist", entry, "", idx-1);
-               idx--;
-               break;
-       /*down*/
-       case 2: 
-               gf_cfg_insert_key(cfg, "Playlist", entry, "", idx+1);
-               idx++;
-               break;
-       }
-       refresh_playlist();
-    SendMessage(hList, LB_SETCURSEL, idx, 0);
-       SetFocus(hList);
-}
-
-Bool add_files(void *cbk, char *name, char *path)
-{
-       if (!bViewUnknownTypes && extension_list) {
-               char *ext = strrchr(name, '.');
-               if (!ext || !strstr(extension_list, ext+1)) return 0;
-       }
-       gf_cfg_set_key(cfg, "Playlist", path, "");
-       return 0;
-}
-
-void process_list_change(HWND hWnd, Bool add_to_pl)
-{
-       TCHAR sTxt[GF_MAX_PATH];
-    if (!SendMessage(hList, LB_GETSELCOUNT, 0, 0)) return;
-
-    u32 idx = SendMessage(hList, LB_GETCURSEL, 0, 0);
-       SendMessage(hList, LB_GETTEXT, idx, (LPARAM)(LPCTSTR) sTxt);
-
-       DWORD param = SendMessage(hList, LB_GETITEMDATA, idx, 0);
-       if (param==1) {
-               if (!wcscmp(sTxt, _T("+ ..") ) ) {
-                       if (add_to_pl) return;
-                       current_dir[strlen((const char *) current_dir)-1] = 0;
-                       char *b = strrchr((const char *) current_dir, '\\');
-                       if (b) b[1] = 0;
-                       else b[0] = '\\';
-                       CE_CharToWide((char *) current_dir, (u16 *) w_current_dir);
-                       set_directory(w_current_dir);
-               } else {
-                       if (add_to_pl) {
-                               char dir[MAX_PATH];
-                               TCHAR wdir[MAX_PATH];
-                               wcscpy(wdir, w_current_dir);
-                               wcscat(wdir, sTxt+2);
-                               wcscat(wdir, _T("\\"));
-                               CE_WideToChar((u16 *) wdir, (char *) dir);
-                               gf_enum_directory(dir, 0, add_files, NULL, NULL);
-                       } else {
-                               wcscat(w_current_dir, sTxt+2);
-                               wcscat(w_current_dir, _T("\\"));
-                               CE_WideToChar((u16 *) w_current_dir, (char *) current_dir);
-                               set_directory(w_current_dir);
-                       }
-               }
-       } else {
-               char szTxt[1024];
-               CE_WideToChar((u16 *) sTxt, (char *) szTxt);
-               strcpy((char *) out_url, (const char *) current_dir);
-               strcat(out_url, szTxt);
-               if (add_to_pl) {
-                       gf_cfg_set_key(cfg, "Playlist", out_url, "");
-                       strcpy(out_url, "");
-               } else {
-                       if (playlist_mode) {
-                               const char *file;
-                               char szPLE[20];
-                               sprintf(szPLE, "%d", idx);
-                               gf_cfg_set_key(cfg, "General", "PLEntry", szPLE);
-                               file = gf_cfg_get_key_name(cfg, "Playlist", idx);
-                               strcpy(out_url, file);
-                       }
-                       gf_cfg_set_key(cfg, "General", "LastWorkingDir", (const char *) current_dir);
-                       EndDialog(hWnd, 1);
-               }
-       }
-}
-
-BOOL InitFileDialog(const HWND hWnd)
-{
-    TCHAR           psz[80];
-    ZeroMemory(psz, sizeof(psz));
-    SHINITDLGINFO sid;
-       ZeroMemory(&sid, sizeof(sid));
-    sid.dwMask  = SHIDIM_FLAGS;
-    sid.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
-    sid.hDlg    = hWnd;
-
-       if (FALSE == SHInitDialog(&sid))
-               return FALSE;
-
-    SHMENUBARINFO mbi;
-       ZeroMemory(&mbi, sizeof(SHMENUBARINFO));
-       mbi.cbSize      = sizeof(SHMENUBARINFO);
-       mbi.hwndParent  = hWnd;
-       mbi.nToolBarId  = IDR_MENU_OPEN;
-       mbi.hInstRes    = g_hInst;
-
-    if (FALSE == SHCreateMenuBar(&mbi))
-    {
-        return FALSE;
-    }
-    g_hWndMenuBar = mbi.hwndMB;
-    
-    ShowWindow(g_hWndMenuBar, SW_SHOW);
-
-       the_wnd = hWnd;
-
-    hDirTxt = GetDlgItem(hWnd, IDC_DIRNAME);
-    hList = GetDlgItem(hWnd, IDC_FILELIST);
-    g_hMenuView = (HMENU)SendMessage(g_hWndMenuBar, SHCMBM_GETSUBMENU, 0, ID_OF_VIEW);
-
-       RECT rc;
-       GetClientRect(hWnd, &rc);
-       u32 caption_h = GetSystemMetrics(SM_CYCAPTION) - 3;
-       MoveWindow(hDirTxt, 0, 0, rc.right - rc.left, caption_h, 1);
-       MoveWindow(hList, 0, caption_h, rc.right - rc.left, rc.bottom - rc.top - caption_h, 1);
-       
-       if (playlist_mode) {
-               refresh_playlist();
-       } else {
-               if (!strcmp((const char *) current_dir, "\\")) {
-                       char *opt = (char *) gf_cfg_get_key(cfg, "General", "LastWorkingDir");
-                       if (opt) CE_CharToWide(opt, (u16 *) w_current_dir);
-               }
-               set_directory(w_current_dir);
-       }
-       switch_menu_pl();
-       return TRUE;
-}
-
-BOOL CALLBACK FileDialogProc(const HWND hWnd, const UINT Msg, const WPARAM wParam, const LPARAM lParam) 
-{
-       BOOL bProcessedMsg = TRUE;
-
-    switch (Msg) {
-    case WM_INITDIALOG:
-        if (FALSE == InitFileDialog(hWnd))
-            EndDialog(hWnd, -1);
-        break;
-
-    case WM_ACTIVATE:
-        if (WA_INACTIVE != LOWORD(wParam)) SetFocus(hWnd);
-        break;
-
-    case WM_CLOSE:
-               EndDialog(hWnd, 0);
-               break;
-
-    case WM_COMMAND:
-               if (LOWORD(wParam) == IDC_FILELIST) {
-                       if (HIWORD(wParam) == LBN_DBLCLK) {
-                       process_list_change(hWnd, 0);
-                       } else {
-                   bProcessedMsg = FALSE;
-                       }
-               } else {
-                       switch (LOWORD(wParam)) {
-                       case IDOK:
-                               process_list_change(hWnd, 0);
-                               break;
-                       case IDCANCEL:
-                               EndDialog(hWnd, 0);
-                               break;
-                       case IDM_OF_VIEW_ALL:
-                               bViewUnknownTypes = !bViewUnknownTypes;
-                               refresh_menu_states();
-                               set_directory(w_current_dir);
-                               break;
-                       case IDM_OF_PLAYLIST:
-                               playlist_mode = !playlist_mode;
-                               if (playlist_mode) refresh_playlist();
-                               else set_directory(w_current_dir);
-                               switch_menu_pl();
-                               break;
-                       case IDM_OF_PL_ACT:
-                               if (playlist_mode) {
-                                       playlist_act(0);
-                               } else {
-                                       process_list_change(hWnd, 1);
-                               }
-                               break;
-                       case IDM_OF_PL_UP:
-                               playlist_act(1);
-                               break;
-                       case IDM_OF_PL_DOWN:
-                               playlist_act(2);
-                               break;
-                       case IDM_OF_PL_CLEAR:
-                               playlist_act(3);
-                               break;
-                       default:
-                               bProcessedMsg = FALSE;
-                               break;
-                       }
-               }
-        break;
-       case WM_KEYDOWN:
-               switch (wParam) {
-               case VK_LEFT: 
-               case '1': 
-                       playlist_act(1); 
-                       break;
-               case VK_RIGHT: 
-               case '2': 
-                       playlist_act(2); 
-                       break;
-               default:
-            bProcessedMsg = FALSE;
-                       break;
-               }
-               break;
-
-    default:
-        bProcessedMsg = FALSE;
-    }
-    
-    return bProcessedMsg;
-}
-
-Bool gf_file_dialog(HINSTANCE inst, HWND parent, char *url, const char *ext_list, GF_Config *gpac_cfg)
-{
-       extension_list = ext_list;
-       out_url = url;
-       g_hInst = inst;
-       cfg = gpac_cfg;
-       int iResult = DialogBox(inst, MAKEINTRESOURCE(IDD_FILEDIALOG), parent,(DLGPROC)FileDialogProc);
-       if (iResult>0) return 1;
-       return 0;
-}
-
-
-#endif
-
diff --git a/applications/osmophone/osmophone.rc b/applications/osmophone/osmophone.rc
deleted file mode 100644 (file)
index 4a0b80e..0000000
+++ /dev/null
@@ -1,423 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "newres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Anglais (États-Unis) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_ICON                ICON                    "../../doc/osmo4.ico"
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE 
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE 
-BEGIN
-    "#include ""newres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE 
-BEGIN
-    "\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// RCDATA
-//
-
-IDM_MAIN_MENU1 RCDATA 
-BEGIN
-    0x0066, 0x0002, 0xfffe, 0x9c53, 0x0004, 0x0018, 0x9c55, 0x0000, 0x0000, 
-    0xfffe, 0x9c58, 0x0004, 0x0018, 0x9c59, 0x0000, 0x0001
-END
-
-IDR_ABOUT_MENU RCDATA 
-BEGIN
-    0x006b, 0x0001, 0xfffe, 0x9c77, 0x0004, 0x0010, 0x9c6c, 0x0000, 0xffff
-
-END
-
-IDM_MAIN_MENU2 RCDATA 
-BEGIN
-    0x006c, 0x0002, 0xfffe, 0x9c83, 0x0004, 0x0018, 0x9c85, 0x0000, 0x0000, 
-    0xfffe, 0x9c87, 0x0004, 0x0018, 0x9c89, 0x0000, 0x0001
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDM_MAIN_MENU MENU 
-BEGIN
-    POPUP "File"
-    BEGIN
-        MENUITEM "Open",                        IDM_FILE_OPEN
-        MENUITEM "Open URL",                    IDM_FILE_OPEN_URL
-        POPUP "Recent"
-        BEGIN
-            MENUITEM "FILE 1",                      IDM_OPEN_FILE1
-            MENUITEM "FILE 2",                      IDM_OPEN_FILE2
-            MENUITEM "FILE 3",                      IDM_OPEN_FILE3
-            MENUITEM "FILE 4",                      IDM_OPEN_FILE4
-            MENUITEM "FILE 5",                      IDM_OPEN_FILE5
-            MENUITEM "FILE 6",                      IDM_OPEN_FILE6
-            MENUITEM "FILE 7",                      IDM_OPEN_FILE7
-            MENUITEM "FILE 8 ",                     IDM_OPEN_FILE8
-            MENUITEM "FILE 9",                      IDM_OPEN_FILE9
-        END
-        MENUITEM SEPARATOR
-        MENUITEM "Pause",                       IDM_FILE_PAUSE
-        MENUITEM "Copy/Paste",                  ID_FILE_CUT_PASTE
-        MENUITEM SEPARATOR
-        POPUP "Logs"
-        BEGIN
-            POPUP "Level"
-            BEGIN
-                MENUITEM "None",                        ID_LOGLEVEL_NONE
-                MENUITEM "Error",                       ID_LOGLEVEL_ERROR
-                MENUITEM "Warning",                     ID_LOGLEVEL_WARNING
-                MENUITEM "Info",                        ID_LOGLEVEL_INFO
-                MENUITEM "Debug",                       ID_LOGLEVEL_DEBUG
-            END
-            POPUP "Tools"
-            BEGIN
-                MENUITEM "core",                        ID_TOOLS_CORE
-                MENUITEM "coding",                      ID_TOOLS_CODING
-                MENUITEM "container",                   ID_TOOLS_CONTAINER
-                MENUITEM "network",                     ID_TOOLS_NETWORK
-                MENUITEM "rtp",                         ID_TOOLS_RTP
-                MENUITEM "sync",                        ID_TOOLS_SYNC
-                MENUITEM "codec",                       ID_TOOLS_CODEC
-                MENUITEM "parser",                      ID_TOOLS_PARSER
-                MENUITEM "media",                       ID_TOOLS_MEDIA
-                MENUITEM "scene",                       ID_TOOLS_SCENE
-                MENUITEM "script",                      ID_TOOLS_SCRIPT
-                MENUITEM "interact",                    ID_TOOLS_INTERACT
-                MENUITEM "compose",                     ID_TOOLS_COMPOSE
-                MENUITEM "mmio",                        ID_TOOLS_MMIO
-                MENUITEM "rti",                         ID_TOOLS_RTI
-                MENUITEM SEPARATOR
-                MENUITEM "none",                        ID_TOOLS_NONE
-                MENUITEM "all",                         ID_TOOLS_ALL
-            END
-            MENUITEM "Reset",                       ID_LOGS_RESET
-            MENUITEM "Log CPU",                     IDM_FILE_LOG_RTI
-        END
-        MENUITEM SEPARATOR
-        MENUITEM "Exit",                        IDM_ITEM_QUIT
-    END
-    POPUP "View"
-    BEGIN
-        POPUP "Navigate"
-        BEGIN
-            MENUITEM "Reset",                       IDM_NAV_RESET
-            MENUITEM SEPARATOR
-            MENUITEM "None",                        IDM_NAV_NONE
-            MENUITEM "Slide",                       IDM_NAV_SLIDE
-            MENUITEM "Walk",                        IDM_NAV_WALK
-            MENUITEM "Fly",                         IDM_NAV_FLY
-            MENUITEM "Examine",                     IDM_NAV_EXAMINE
-            MENUITEM SEPARATOR
-            MENUITEM "Headlight",                   IDM_NAV_HEADLIGHT
-            MENUITEM "Gravity",                     IDM_NAV_GRAVITY
-            POPUP "Collision"
-            BEGIN
-                MENUITEM "Disabled",                    IDM_NAV_COL_NONE
-                MENUITEM "Regular",                     IDM_NAV_COL_REG
-                MENUITEM "Displacement",                IDM_NAV_COL_DISP
-            END
-        END
-        MENUITEM SEPARATOR
-        MENUITEM "Fullscreen",                  IDM_VIEW_FS
-        POPUP "Info"
-        BEGIN
-            MENUITEM "Status Bar",                  IDM_VIEW_STATUS
-            MENUITEM "CPU usage",                   IDM_VIEW_CPU
-        END
-        MENUITEM SEPARATOR
-        POPUP "Video"
-        BEGIN
-            MENUITEM "Direct FB",                   ID_VIDEO_DIRECTFB
-            MENUITEM "GAPI",                        ID_VIDEO_GAPI
-            MENUITEM "GDI",                         ID_VIDEO_GDI
-            MENUITEM SEPARATOR
-            MENUITEM "2D OpenGL",                   IDM_VIEW_FORCEGL
-            MENUITEM "Direct Draw",                 ID_VIDEO_DIRECTDRAW
-            MENUITEM "15.0 FPS",                    IDM_VIEW_LOW_RATE
-            POPUP "Aspect Ratio"
-            BEGIN
-                MENUITEM "Keep Original",               IDM_VIEW_AR_NONE
-                MENUITEM "Fill Screen",                 IDM_VIEW_AR_FILL
-                MENUITEM "Ratio 4/3",                   IDM_VIEW_AR_4_3
-                MENUITEM "Ratio 16/9",                  IDM_VIEW_AR_16_9
-            END
-        END
-        POPUP "Options"
-        BEGIN
-            MENUITEM "Progressive SVG ",            IDM_VIEW_SVG_LOAD
-            MENUITEM "Disable Playlist",            IDS_CAP_DISABLE_PLAYLIST
-        END
-        MENUITEM "About",                       IDM_VIEW_ABOUT
-    END
-END
-
-IDR_ABOUT_MENU MENU 
-BEGIN
-    MENUITEM "OK",                          IDM_ABOUT_OK
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE 
-BEGIN
-    IDS_CLASSNAME           "Osmophone"
-    IDS_WINDOWNAME          "Osmo4"
-    IDS_APPNAME             "Osmophone.exe"
-END
-
-STRINGTABLE 
-BEGIN
-    IDS_CAP_QUIT            "Exit"
-    IDS_CAP_FILE            "File"
-    IDS_CAP_EXIT            "View"
-    IDS_CAP_VIEW            "View"
-END
-
-STRINGTABLE 
-BEGIN
-    IDS_CAP_OK              "OK"
-END
-
-STRINGTABLE 
-BEGIN
-    IDS_CAP_NAVIGATE        "Navigate"
-END
-
-STRINGTABLE 
-BEGIN
-    IDS_CAP_OPTION          "Options"
-    IDS_CAP_MENUITEM40072   "?"
-END
-
-STRINGTABLE 
-BEGIN
-    IDS_CAP_DISABLE_PLAYLIST "Copy/Paste"
-END
-
-#endif    // Anglais (États-Unis) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Français (France) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
-#ifdef _WIN32
-LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// RCDATA
-//
-
-IDR_MENU_OPEN RCDATA 
-BEGIN
-    0x006a, 0x0002, 0xfffe, 0x9c9b, 0x0004, 0x0010, 0x9c9f, 0x0000, 0xffff, 
-    0xfffe, 0x9c9a, 0x0004, 0x0018, 0x9c59, 0x0000, 0x0001
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_MENU_OPEN MENU 
-BEGIN
-    MENUITEM "Add",                         IDM_OF_PL_ACT
-    POPUP "View"
-    BEGIN
-        MENUITEM "All Unknown Files",           IDM_OF_VIEW_ALL
-        MENUITEM "Move Up",                     IDM_OF_PL_UP
-        MENUITEM "Move Down",                   IDM_OF_PL_DOWN
-        MENUITEM "Clear",                       IDM_OF_PL_CLEAR
-        MENUITEM SEPARATOR
-        MENUITEM "Playlist Mode",               IDM_OF_PLAYLIST
-    END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO 
-BEGIN
-    IDD_APPABOUT, DIALOG
-    BEGIN
-        LEFTMARGIN, 1
-        RIGHTMARGIN, 113
-        BOTTOMMARGIN, 74
-    END
-
-    IDD_FILEDIALOG, DIALOG
-    BEGIN
-        RIGHTMARGIN, 103
-        BOTTOMMARGIN, 85
-    END
-END
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_APPABOUT DIALOG  0, 0, 114, 77
-STYLE DS_SETFONT | DS_SETFOREGROUND | WS_POPUP | WS_CAPTION
-CAPTION "About Osmophone"
-FONT 8, "System"
-BEGIN
-    ICON            IDI_ICON,IDC_STATIC,1,0,16,16
-    CTEXT           "Osmo4/GPAC\n""0.4.5"" (build ""33"")",IDC_NAMECTRL,23,1,65,17
-    CTEXT           "Copyright (c) 2007 ENST\nAll Rights Reserved\nLicensed under LGPL",IDC_STATIC,2,44,111,33
-END
-
-IDD_FILEDIALOG DIALOG  0, 0, 104, 86
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Select File"
-FONT 8, "System"
-BEGIN
-    EDITTEXT        IDC_DIRNAME,1,3,100,12,ES_AUTOHSCROLL | ES_READONLY
-    LISTBOX         IDC_FILELIST,1,18,102,65,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040c04b0"
-        BEGIN
-            VALUE "CompanyName", "ENST"
-            VALUE "FileDescription", "osmophone"
-            VALUE "FileVersion", "1, 0, 0, 1"
-            VALUE "InternalName", "osmophone"
-            VALUE "LegalCopyright", "Copyright Â© 2008"
-            VALUE "OriginalFilename", "osmophone.exe"
-            VALUE "ProductName", "ENST GPAC"
-            VALUE "ProductVersion", "1, 0, 0, 1"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x40c, 1200
-    END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE 
-BEGIN
-    IDS_CAP_FILE            "+"
-    IDS_CAP_VIEW            "View"
-END
-
-STRINGTABLE 
-BEGIN
-    IDS_CAP_OK              "OK"
-END
-
-STRINGTABLE 
-BEGIN
-    IDS_CAP_SELECT          "File"
-END
-
-STRINGTABLE 
-BEGIN
-    IDS_CAP_MENUITEM40092   "Add"
-    IDS_CAP_ADD             "Add"
-END
-
-#endif    // Français (France) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
diff --git a/applications/osmophone/resource.h b/applications/osmophone/resource.h
deleted file mode 100644 (file)
index 1b76c23..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by osmophone.rc
-//
-#define IDS_CLASSNAME                   1
-#define IDS_WINDOWNAME                  4
-#define IDS_APPNAME                     5
-#define IDI_ICON                        101
-#define IDM_MENU                        102
-#define IDM_MAIN_MENU                   102
-#define IDM_MAIN_MENU1                  102
-#define IDD_ABOUTBOX                    103
-#define IDD_APPABOUT                    104
-#define IDD_OPENFILE                    105
-#define IDD_FILEDIALOG                  105
-#define IDR_MENU_OPEN                   106
-#define IDR_ABOUT_MENU                  107
-#define IDM_MAIN_MENU2                  108
-#define IDM_MAIN_MENUITEM1              401
-#define IDM_MAIN_MENUITEM2              402
-#define IDS_MAIN_MENUITEM1              410
-#define IDS_MAIN_MENUITEM2              412
-#define IDC_EDIT1                       1001
-#define IDC_DIRNAME                     1001
-#define IDC_LIST1                       1002
-#define IDC_FILELIST                    1002
-#define IDC_LIST2                       1003
-#define IDC_NAMECTRL                    1004
-#define IDM_FILE_EXIT                   40002
-#define IDM_HELP_ABOUT                  40003
-#define IDM_GRAB                        40004
-#define IDM_RELEASE                     40005
-#define ID_FILE_SHOW_WMKEYDOWN          40006
-#define ID_FILE_SHOW_WMKEYUP            40007
-#define ID_FILE_SHOW_WMCHAR             40008
-#define ID_FILE_SHOW_WMMOUSEMOVE        40009
-#define ID_FILE_SHOW_WMLBUTTONDOWN      40010
-#define ID_FILE_SHOW_WMLBUTTONDBLCLK    40011
-#define ID_FILE_SHOW_WMLBUTTONUP        40012
-#define ID_FILE_SHOW_WMRBUTTONDOWN      40013
-#define ID_FILE_SHOW_WMRBUTTONUP        40014
-#define ID_FILE_SHOW_WMRBUTTONDBLCLK    40015
-#define IDM_ITEM_QUIT                   40016
-#define IDS_CAP_QUIT                    40018
-#define ID_MENU_FILE                    40019
-#define IDS_CAP_FILE                    40021
-#define IDM_FILE_OPEN                   40022
-#define IDS_CAP_EXIT                    40023
-#define IDM_MENU_VIEW                   40024
-#define IDS_CAP_VIEW                    40025
-#define IDM_FILE_OPEN_URL               40026
-#define IDM_OPEN_FILE1                  40030
-#define IDM_OPEN_FILE2                  40031
-#define IDM_OPEN_FILE3                  40032
-#define IDM_OPEN_FILE4                  40033
-#define IDM_OPEN_FILE5                  40034
-#define IDM_OPEN_FILE6                  40035
-#define IDM_OPEN_FILE7                  40036
-#define IDM_OPEN_FILE8                  40037
-#define IDM_OPEN_FILE9                  40038
-#define IDM_OPEN_FILE10                 40039
-#define ID_VIEW                         40040
-#define IDM_OF_VIEW_ALL                 40041
-#define IDS_CAP_OK                      40044
-#define IDS_CAP_MENUITEM40045           40046
-#define ID_SELECT                       40047
-#define IDS_CAP_SELECT                  40049
-#define IDM_OF_PL_ADD                   40050
-#define IDM_OF_PLAYLIST                 40051
-#define IDM_OF_PL_REM                   40052
-#define IDM_VIEW_FS                     40053
-#define IDM_VIEW_ABOUT                  40054
-#define IDM_ABOUT_OK                    40055
-#define IDM_VIEW_STATUS                 40057
-#define IDM_VIEW_FORCEGL                40058
-#define ID_NAVIGATE                     40059
-#define IDS_CAP_NAVIGATE                40061
-#define IDM_NAV_NONE                    40062
-#define IDM_NAV_SLIDE                   40063
-#define IDM_SELECT                      40064
-#define IDM_NAV_RESET                   40065
-#define IDM_MENU_SWITCH                 40066
-#define ID_OPTION                       40067
-#define IDS_CAP_OPTION                  40069
-#define ID_MENUITEM40071                40071
-#define IDS_CAP_MENUITEM40072           40073
-#define IDM_NAV_WALK                    40074
-#define IDM_NAV_FLY                     40075
-#define IDM_NAV_EXAMINE                 40076
-#define IDM_NAV_HEADLIGHT               40077
-#define IDM_NAV_GRAVITY                 40078
-#define IDM_NAV_COL_NONE                40079
-#define IDM_NAV_COL_REG                 40080
-#define IDM_NAV_COL_DISP                40081
-#define IDM_VIEW_AR_NONE                40082
-#define IDM_VIEW_AR_FILL                40083
-#define IDM_VIEW_AR_4_3                 40084
-#define IDM_VIEW_AR_16_9                40085
-#define IDM_OF_PL_UP                    40088
-#define IDM_OF_PL_DOWN                  40089
-#define ID_OF_VIEW                      40090
-#define IDM_OF_PL_ACT                   40091
-#define IDS_CAP_MENUITEM40092           40093
-#define IDS_CAP_ADD                     40095
-#define IDM_OF_PL_CLEAR                 40096
-#define IDM_FILE_LOG_RTI                40097
-#define IDM_VIEW_CPU                    40098
-#define IDM_FILE_PAUSE                  40099
-#define IDM_VIEW_LOW_RATE               40100
-#define IDM_VIEW_SVG_LOAD               40102
-#define IDS_CAP_DISABLE_PLAYLIST        40103
-#define ID_FILE_CUT_PASTE               40104
-#define Fra                             40105
-#define ID_VIDEO_DIRECTFB               40106
-#define ID_VIDEO_GAPI                   40107
-#define ID_VIDEO_GDI                    40108
-#define ID_VIDEO_DIRECTDRAW             40109
-#define ID_OPTIONS_TEST                 40111
-#define ID_VIEW_INFO                    40112
-#define ID_Menu                         40113
-#define ID_OPTIONS_TEST40114            40114
-#define ID_OPTIONS_VIDEOOUT             40115
-#define ID_VIDEOOUT_FD                  40116
-#define ID_OPTIONS_VIDEOOUT40117        40117
-#define ID_FILE_LOGS                    40118
-#define ID_FILE_DS                      40119
-#define ID_LOGS_ENABLED                 40120
-#define ID_LOGS_LEVEL                   40121
-#define ID_LEVEL_DEBUG                  40122
-#define ID_LEVEL_WARNING                40123
-#define ID_LEVEL_INFO                   40124
-#define ID_LEVEL_DEBUG40125             40125
-#define ID_LOGLEVEL_ERROR               40126
-#define ID_LOGLEVEL_WARNING             40127
-#define ID_LOGLEVEL_INFO                40128
-#define ID_LOGLEVEL_DEBUG               40129
-#define ID_LOGS_TOOLS                   40130
-#define ID_LOGTOOL_CORE                 40131
-#define ID_TOOLS_CODING                 40132
-#define ID_TOOLS_CONTAINER              40133
-#define ID_TOOLS_NETWORK                40134
-#define ID_TOOLS_RTP                    40135
-#define ID_TOOLS_SYNC                   40136
-#define ID_TOOLS_CODEC                  40137
-#define ID_TOOLS_PARSER                 40138
-#define ID_TOOLS_MEDIA                  40139
-#define ID_TOOLS_SCENE                  40140
-#define ID_TOOLS_SCRIPT                 40141
-#define ID_TOOLS_INTERACT               40142
-#define ID_TOOLS_COMPOSE                40143
-#define ID_TOOLS_MMIO                   40144
-#define ID_TOOLS_RTI                    40145
-#define ID_TOOLS_NONE                   40146
-#define ID_TOOLS_ALL                    40147
-#define ID_TOOLS_CORE                   40148
-#define ID_LEVEL_NONE                   40149
-#define ID_LOGLEVEL_NONE                40150
-#define ID_LOGS_RESET                   40151
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        111
-#define _APS_NEXT_COMMAND_VALUE         40152
-#define _APS_NEXT_CONTROL_VALUE         1005
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
index 20da3131188513610d87e97f20f9e77c000b6c31..49025fe0f2093751bbb49f6d3cdef2bb31b2101b 100644 (file)
@@ -10,7 +10,7 @@
 <br/>
 <b><span style="Font-Size: 24pt">GPAC Configuration file documentation<br/>Version 0.4.5</span></b>
 <br/>
-<b><span style="Font-Size: 18pt">Last Modified $LastChangedDate: 2011-06-14 16:39:53 +0200(mar, 14 giu 2011) $</span></b>
+<b><span style="Font-Size: 18pt">Last Modified $LastChangedDate: 2011-07-27 18:04:41 +0200 (mer, 27 lug 2011) $</span></b>
 </p>
 
 <br/><br/>
@@ -226,6 +226,10 @@ handling and "Multi" means that each decoder runs in its own thread.
 <p style="text-indent: 5%">
 Specifies the priority of the decoders (priority is applied to decoder thread(s) regardless of threading mode).
 </p>
+<b>ModuleUnload</b> [value: <i>"yes" "no"</i>]
+<p style="text-indent: 5%">
+Specifies whether modules should be unloaded if not used or not. Default: "yes".
+</p>
 <b>ResyncLateClock</b> [value: <i>unsigned integer</i>]
 <p style="text-indent: 5%">
 Specifies the threshold after which late clocks are resynchronized to timestamps for OCR streams. By default, no threashold (0) is used and clocks are never resynchronized. This allows to 
index 7063fc598b5e1095a9102ac14c7053d82ac62cd8..00b9854fc71ba877856d0e5d9ba87e5279da2900 100644 (file)
@@ -209,6 +209,9 @@ Uses daisy-chain SIDX instead of hierarchical. Ignored if frags/sidx is 0.
 .TP
 .B \-dash-ctx FILE
 Stores/restore DASH timing from FILE.
+.TP
+.B \-dash-ts-prog N
+Program_number to be considered in case of an MPTS input file.
 
 .B When input file is an ISO-Media file (QT, MP4, 3GP), if no output is specified THE INPUT FILE IS OVERWRITTEN.
 .
index 4cb5f402a12642ee1a0b6942b760c805355228d9..6cd64697d2b2cfce10b749529f7323be94d8679e 100644 (file)
@@ -434,7 +434,7 @@ service restart
 */
 void gf_term_handle_services(GF_Terminal *app);
 /*close service and queue for delete*/
-void gf_term_close_services(GF_Terminal *app, GF_ClientService *service);
+void gf_term_close_service(GF_Terminal *app, GF_ClientService *service);
 
 /*locks media quaue*/
 void gf_term_lock_media_queue(GF_Terminal *app, Bool LockIt);
index 863654bade324b93efe559a07d9d3f1f5ae69b30..872cfaf6ef362c1b7aaf807c677381af72c50044 100644 (file)
@@ -2,7 +2,7 @@ include ../config.mak
 
 #all OS and lib independent
 #PLUGDIRS=aac_in ac3_in audio_filter bifs_dec ctx_load dummy_in soft_raster mp3_in isom_in odf_dec rtp_in timedtext img_in svg_in saf_in mpegts_in ismacryp widgetman redirect_av mpd_in
-PLUGDIRS=aac_in ac3_in audio_filter bifs_dec ctx_load dummy_in soft_raster mp3_in isom_in odf_dec rtp_in timedtext img_in svg_in saf_in mpegts_in ismacryp widgetman mpd_in
+PLUGDIRS=aac_in ac3_in audio_filter bifs_dec ctx_load dummy_in soft_raster mp3_in isom_in odf_dec rtp_in timedtext img_in svg_in saf_in mpegts_in ismacryp widgetman mpd_in osd
 
 ifeq ($(DISABLE_SVG), no)
 PLUGDIRS+=laser_dec svg_in
index c051c7553716d94dc0170e7e78bba3a9426b536f..d812ea59f336b0a89e830644d9fef858c35e5b93 100644 (file)
@@ -259,7 +259,7 @@ static Bool AAC_ConfigureFromFile(AACReader *read)
 
        read->duration = 0;
 
-       if (!read->is_remote) {
+       if (0 && !read->is_remote) {
                read->duration = 1024;
                gf_bs_skip_bytes(bs, hdr.frame_size);
                while (ADTS_SyncFrame(bs, !read->is_remote, &hdr)) {
index bf6ebd8131a2b3c9f26eb83ab84b955e76a35e72..fc050dbc6bbf154986ddfb1b4f634c761994b8b2 100644 (file)
@@ -698,93 +698,126 @@ void DD_InitYUV(GF_VideoOutput *dr)
        w = 720;
        h = 576;
 
-       dd->yuv_init = 1;
 
-#ifdef USE_DX_3
-       IDirectDraw_GetFourCCCodes(dd->pDD, &numCodes, NULL);
-       if (!numCodes) return;
-       codes = (DWORD *)gf_malloc(numCodes*sizeof(DWORD));
-       IDirectDraw_GetFourCCCodes(dd->pDD, &numCodes, codes);
-#else
-       IDirectDraw7_GetFourCCCodes(dd->pDD, &numCodes, NULL);
-       if (!numCodes) return;
-       codes = (DWORD *)gf_malloc(numCodes*sizeof(DWORD));
-       IDirectDraw7_GetFourCCCodes(dd->pDD, &numCodes, codes);
-#endif
-       
-       num_yuv = 0;
-       for (i=0; i<numCodes; i++) {
-               formats[num_yuv] = is_yuv_supported(codes[i]);
-               if (formats[num_yuv]) num_yuv++;
-       }
-       gf_free(codes);
-       
-       
-       dr->hw_caps |= GF_VIDEO_HW_HAS_YUV | GF_VIDEO_HW_HAS_YUV_OVERLAY;
-       
-       /*too bad*/
-       if (!num_yuv) {
-               dr->hw_caps &= ~(GF_VIDEO_HW_HAS_YUV | GF_VIDEO_HW_HAS_YUV_OVERLAY);
-               dr->yuv_pixel_format = 0;
-               return;
+       opt = gf_modules_get_option((GF_BaseInterface *)dr, "Video", "PreferedYUV4CC");
+       if (opt) {
+               char a, b, c, d;
+               if (sscanf(opt, "%c%c%c%c", &a, &b, &c, &d)==4) {
+                       dr->yuv_pixel_format = GF_4CC(a, b, c, d);
+                       dr->hw_caps |= GF_VIDEO_HW_HAS_YUV;
+                       opt = gf_modules_get_option((GF_BaseInterface *)dr, "Video", "HasOverlay");
+                       if (opt && !strcmp(opt, "yes")) 
+                               dr->hw_caps |= GF_VIDEO_HW_HAS_YUV_OVERLAY;
+                       dd->yuv_init = 1;
+                       num_yuv = 1;
+               }
        }
 
-       for (i=0; i<num_yuv; i++) {
-               /*check planar first*/
-               if (!checkPacked && !is_yuv_planar(formats[i])) goto go_on;
-               /*then check packed */
-               if (checkPacked && is_yuv_planar(formats[i])) goto go_on;
+       /*first run on this machine, to some benchmark*/
+       if (! dd->yuv_init) {           
+               char szOpt[100];
+               dd->yuv_init = 1;
 
-               if (dd->yuv_pool.pSurface) {
-                       SAFE_DD_RELEASE(dd->yuv_pool.pSurface);
-                       memset(&dd->yuv_pool, 0, sizeof(DDSurface));
+               dr->hw_caps |= GF_VIDEO_HW_HAS_YUV | GF_VIDEO_HW_HAS_YUV_OVERLAY;
+
+#ifdef USE_DX_3
+               IDirectDraw_GetFourCCCodes(dd->pDD, &numCodes, NULL);
+               if (!numCodes) return;
+               codes = (DWORD *)gf_malloc(numCodes*sizeof(DWORD));
+               IDirectDraw_GetFourCCCodes(dd->pDD, &numCodes, codes);
+#else
+               IDirectDraw7_GetFourCCCodes(dd->pDD, &numCodes, NULL);
+               if (!numCodes) return;
+               codes = (DWORD *)gf_malloc(numCodes*sizeof(DWORD));
+               IDirectDraw7_GetFourCCCodes(dd->pDD, &numCodes, codes);
+#endif
+               
+               num_yuv = 0;
+               for (i=0; i<numCodes; i++) {
+                       formats[num_yuv] = is_yuv_supported(codes[i]);
+                       if (formats[num_yuv]) num_yuv++;
+               }
+               gf_free(codes);
+               
+               /*too bad*/
+               if (!num_yuv) {
+                       dr->hw_caps &= ~(GF_VIDEO_HW_HAS_YUV | GF_VIDEO_HW_HAS_YUV_OVERLAY);
+                       dr->yuv_pixel_format = 0;
+                       return;
                }
 
-               dr->yuv_pixel_format = formats[i];
-               if (DD_GetSurface(dr, w, h, dr->yuv_pixel_format, 1) == NULL)
-                       goto rem_fmt;
+               for (i=0; i<num_yuv; i++) {
+                       /*check planar first*/
+                       if (!checkPacked && !is_yuv_planar(formats[i])) goto go_on;
+                       /*then check packed */
+                       if (checkPacked && is_yuv_planar(formats[i])) goto go_on;
 
-               now = gf_sys_clock();
-               /*perform blank blit*/
-               for (j=0; j<YUV_NUM_TEST; j++) {
-                       if (DD_BlitSurface(dd, &dd->yuv_pool, NULL, NULL, NULL) != GF_OK)
+                       if (dd->yuv_pool.pSurface) {
+                               SAFE_DD_RELEASE(dd->yuv_pool.pSurface);
+                               memset(&dd->yuv_pool, 0, sizeof(DDSurface));
+                       }
+
+                       dr->yuv_pixel_format = formats[i];
+                       if (DD_GetSurface(dr, w, h, dr->yuv_pixel_format, 1) == NULL)
                                goto rem_fmt;
-               }
-               now = gf_sys_clock() - now;
-               if (formats[i]== GF_PIXEL_YV12) 
-                       force_yv12=1;
-
-               if (!checkPacked) {
-                       if (now<min_planar) {
-                               min_planar = now;
-                               best_planar = dr->yuv_pixel_format;
+
+                       now = gf_sys_clock();
+                       /*perform blank blit*/
+                       for (j=0; j<YUV_NUM_TEST; j++) {
+                               if (DD_BlitSurface(dd, &dd->yuv_pool, NULL, NULL, NULL) != GF_OK)
+                                       goto rem_fmt;
                        }
-               } else {
-                       if (now<min_packed) {
-                               min_packed = now;
-                               best_packed = dr->yuv_pixel_format;
+                       now = gf_sys_clock() - now;
+                       if (formats[i]== GF_PIXEL_YV12) 
+                               force_yv12=1;
+
+                       if (!checkPacked) {
+                               if (now<min_planar) {
+                                       min_planar = now;
+                                       best_planar = dr->yuv_pixel_format;
+                               }
+                       } else {
+                               if (now<min_packed) {
+                                       min_packed = now;
+                                       best_packed = dr->yuv_pixel_format;
+                               }
                        }
-               }
 
 go_on:
-               if (checkPacked && (i+1==num_yuv)) {
-                       i = -1;
-                       checkPacked = FALSE;
-               }
-               continue;
+                       if (checkPacked && (i+1==num_yuv)) {
+                               i = -1;
+                               checkPacked = FALSE;
+                       }
+                       continue;
 
 rem_fmt:
-               for (j=i; j<num_yuv-1; j++) {
-                       formats[j] = formats[j+1];
+                       for (j=i; j<num_yuv-1; j++) {
+                               formats[j] = formats[j+1];
+                       }
+                       i--;
+                       num_yuv--;
                }
-               i--;
-               num_yuv--;
-       }
 
-       if (dd->yuv_pool.pSurface) {
-               SAFE_DD_RELEASE(dd->yuv_pool.pSurface);
-               memset(&dd->yuv_pool, 0, sizeof(DDSurface));
+               if (dd->yuv_pool.pSurface) {
+                       SAFE_DD_RELEASE(dd->yuv_pool.pSurface);
+                       memset(&dd->yuv_pool, 0, sizeof(DDSurface));
+               }
+
+               if (best_planar && (min_planar <= min_packed )) {
+                       dr->yuv_pixel_format = best_planar;
+               } else {
+                       min_planar = min_packed;
+                       dr->yuv_pixel_format = best_packed;
+               } 
+               if (force_yv12)
+                       dr->yuv_pixel_format = GF_PIXEL_YV12;
+
+               /*store our options*/
+               sprintf(szOpt, "%c%c%c%c", (dr->yuv_pixel_format>>24) & 0xFF, (dr->yuv_pixel_format>>16) & 0xFF, (dr->yuv_pixel_format>>8) & 0xFF, (dr->yuv_pixel_format) & 0xFF);
+               gf_modules_set_option((GF_BaseInterface *)dr, "Video", "PreferedYUV4CC", szOpt);
+               gf_modules_set_option((GF_BaseInterface *)dr, "Video", "HasOverlay", (dr->hw_caps & GF_VIDEO_HW_HAS_YUV_OVERLAY) ? "yes" : "no");
        }
+
        opt = gf_modules_get_option((GF_BaseInterface *)dr, "Video", "HardwareMemory");
        if (opt && !strcmp(opt, "Never")) num_yuv = 0;
 
@@ -796,15 +829,6 @@ rem_fmt:
                return;
        }
 
-       if (best_planar && (min_planar <= min_packed )) {
-               dr->yuv_pixel_format = best_planar;
-       } else {
-               min_planar = min_packed;
-               dr->yuv_pixel_format = best_packed;
-       } 
-       if (force_yv12)
-               dr->yuv_pixel_format = GF_PIXEL_YV12;
-
        GF_LOG(GF_LOG_INFO, GF_LOG_MMIO, ("[DX Out] Picked YUV format %s - drawn in %d ms\n", gf_4cc_to_str(dr->yuv_pixel_format), min_planar));
 
        /*enable YUV->RGB on the backbuffer ?*/
diff --git a/modules/osd/Makefile b/modules/osd/Makefile
new file mode 100644 (file)
index 0000000..2920b65
--- /dev/null
@@ -0,0 +1,57 @@
+include ../../config.mak\r
+\r
+vpath %.c $(SRC_PATH)/modules/osd\r
+\r
+CFLAGS= $(OPTFLAGS) -I"$(SRC_PATH)/include"\r
+\r
+ifeq ($(DEBUGBUILD), yes)\r
+CFLAGS+=-g\r
+LDFLAGS+=-g\r
+endif\r
+\r
+ifeq ($(GPROFBUILD), yes)\r
+CFLAGS+=-pg\r
+LDFLAGS+=-pg\r
+endif\r
+\r
+LINKLIBS= -lgpac\r
+LOCAL_LIB=../../bin/gcc\r
+\r
+#common objects\r
+OBJS=osd.o\r
+\r
+SRCS := $(OBJS:.o=.c) \r
+\r
+LIB=gm_osd.$(DYN_LIB_SUFFIX)\r
+\r
+\r
+all: $(LIB)\r
+\r
+\r
+$(LIB): $(OBJS)\r
+       $(CC) $(SHFLAGS) $(LDFLAGS) -o ../../bin/gcc/$@ $(OBJS) $(EXTRALIBS) -L$(LOCAL_LIB) $(LINKLIBS)\r
+\r
+\r
+%.o: %.c\r
+       $(CC) $(CFLAGS) -c -o $@ $< \r
+\r
+\r
+clean: \r
+       rm -f $(OBJS) ../../bin/gcc/$(LIB)\r
+\r
+dep: depend\r
+\r
+depend:\r
+       rm -f .depend   \r
+       $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend\r
+\r
+distclean: clean\r
+       rm -f Makefile.bak .depend\r
+\r
+\r
+\r
+# include dependency files if they exist\r
+#\r
+ifneq ($(wildcard .depend),)\r
+include .depend\r
+endif\r
diff --git a/modules/osd/osd.c b/modules/osd/osd.c
new file mode 100644 (file)
index 0000000..40c2cfc
--- /dev/null
@@ -0,0 +1,300 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Authors: Jean le Feuvre\r
+ *                     Copyright (c) 2011-20XX ENST\r
+ *                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / User Event Recorder sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#include <gpac/modules/term_ext.h>\r
+#include <gpac/internal/terminal_dev.h>\r
+#include <gpac/internal/compositor_dev.h>\r
+#include <gpac/nodes_mpeg4.h>\r
+\r
+\r
+typedef struct\r
+{\r
+       GF_ObjectManager *odm;\r
+       GF_Terminal *term;\r
+       GF_TermEventFilter evt_filter;\r
+\r
+       /*some of our nodes*/\r
+       M_Switch *visible;\r
+       M_Transform2D *transform;\r
+       M_CompositeTexture2D *ct2d;\r
+       M_Text *text;\r
+\r
+       char statBuffer[100];\r
+       u32 refresh_time_ms;\r
+       GF_SystemRTInfo rti;\r
+} GF_OSD;\r
+\r
+static GFINLINE GF_Node *create_node(GF_OSD *osd, u32 tag, GF_Node *par)\r
+{\r
+       GF_Node *n = gf_node_new(osd->odm->subscene->graph, tag);\r
+       if (n) {\r
+               gf_node_init(n);\r
+               if (par) {\r
+                       gf_node_list_add_child( & ((GF_ParentNode *)par)->children, n);\r
+                       gf_node_register(n, par);\r
+               }\r
+       }\r
+       return n;\r
+}\r
+const char *osd_scene_graph = "\\r
+EXTERNPROTO Untransform [\\r
+    exposedField MFNode children []\\r
+]\\r
+[ \"urn:inet:gpac:builtin:Untransform\"]\\r
+OrderedGroup {\\r
+ children [\\r
+  Untransform {\\r
+   children [\\r
+  DEF N1 Switch {\\r
+   whichChoice 0\\r
+   choice [\\r
+    DEF N2 Transform2D {\\r
+     children [\\r
+      Shape {\\r
+       appearance Appearance {\\r
+        material Material2D {\\r
+         transparency 0\\r
+         filled TRUE\\r
+        }\\r
+        texture DEF N3 CompositeTexture2D {\\r
+         pixelWidth 256\\r
+         pixelHeight 16\\r
+         children [\\r
+          Background2D {backColor 0.6 0.6 0.6}\\r
+          Shape {\\r
+           appearance Appearance {\\r
+            material Material2D {\\r
+             emissiveColor 0 0 0\\r
+             filled TRUE\\r
+            }\\r
+           }\\r
+           geometry DEF N4 Text {\\r
+            string [\"My Sample Text !\"]\\r
+            fontStyle FontStyle {\\r
+             size 12\\r
+             justify [\"MIDDLE\", \"MIDDLE\"]\\r
+             family [\"SANS\"]\\r
+            }\\r
+           }\\r
+          }\\r
+         ]\\r
+        }\\r
+       }\\r
+       geometry Bitmap {}\\r
+      }\\r
+     ]\\r
+    }\\r
+   ]\\r
+  }\\r
+   ]\\r
+  }\\r
+ ]\\r
+}\\r
+";\r
+\r
+void osd_on_resize(GF_Node *hdl, GF_DOM_Event *event, GF_Node *observer)\r
+{\r
+       GF_DOMHandler *the_hdl = (GF_DOMHandler *) hdl;\r
+       GF_OSD *osd = the_hdl->evt_listen_obj;\r
+\r
+       if (osd->ct2d) {\r
+               //osd->ct2d->pixelWidth = FIX2INT(event->screen_rect.width);\r
+               gf_node_dirty_set((GF_Node *) osd->ct2d, GF_SG_NODE_DIRTY, 1);\r
+\r
+               if (osd->transform) {\r
+                       osd->transform->translation.y = INT2FIX( (event->screen_rect.height - osd->ct2d->pixelHeight) ) / 2;\r
+                       gf_node_dirty_set((GF_Node *) osd->transform, GF_SG_NODE_DIRTY, 1);\r
+               }\r
+       }\r
+}\r
+\r
+Bool osd_load_scene(GF_OSD *osd)\r
+{\r
+       GF_Node *n;\r
+       GF_List *nodes;\r
+       const char *opt;\r
+       GF_DOMHandler *hdl;\r
+       /*BT/VRML from string*/\r
+       GF_List *gf_sm_load_bt_from_string(GF_SceneGraph *in_scene, const char *node_str, Bool force_wrl);\r
+\r
+       /*create a new scene*/\r
+       osd->odm = gf_odm_new();\r
+       osd->odm->term = osd->term;\r
+       osd->odm->subscene = gf_scene_new(NULL);\r
+       osd->odm->subscene->root_od = osd->odm;\r
+       gf_sg_set_scene_size_info(osd->odm->subscene->graph, 0, 0, 1);\r
+\r
+       /*create a scene graph*/\r
+       nodes = gf_sm_load_bt_from_string(osd->odm->subscene->graph, osd_scene_graph, 0);\r
+       n = gf_list_get(nodes, 0);\r
+       gf_list_del(nodes);\r
+\r
+       if (!n) return 0;\r
+       \r
+       gf_sg_set_root_node(osd->odm->subscene->graph, n);\r
+       gf_sg_set_scene_size_info(osd->odm->subscene->graph, 0, 0, 1);\r
+\r
+       hdl = gf_dom_listener_build(n, GF_EVENT_RESIZE, 0);\r
+       hdl->handle_event = osd_on_resize;\r
+       hdl->evt_listen_obj = osd;\r
+\r
+       osd->visible = (M_Switch *)gf_sg_find_node_by_name(osd->odm->subscene->graph, "N1");\r
+       osd->transform = (M_Transform2D *)gf_sg_find_node_by_name(osd->odm->subscene->graph, "N2");\r
+       osd->ct2d = (M_CompositeTexture2D *)gf_sg_find_node_by_name(osd->odm->subscene->graph, "N3");\r
+       osd->text = (M_Text *)gf_sg_find_node_by_name(osd->odm->subscene->graph, "N4");\r
+       if (osd->text->string.vals[0]) {\r
+               gf_free(osd->text->string.vals[0]);\r
+               osd->text->string.vals[0] = NULL;\r
+       }\r
+       strcpy(osd->statBuffer, "Hello World !");\r
+       osd->text->string.vals[0] = osd->statBuffer;\r
+\r
+       opt = gf_cfg_get_key(osd->term->user->config, "OSD", "Visible");\r
+       if (!opt || strcmp(opt, "yes")) osd->visible->whichChoice = -1;\r
+\r
+\r
+       return 1;\r
+}\r
+\r
+\r
+Bool osd_on_event_play(GF_OSD*osd , GF_Event *event, Bool consumed_by_compositor)\r
+{\r
+       switch (event->type) {\r
+       case GF_EVENT_SCENE_SIZE:\r
+               gf_sg_set_scene_size_info(osd->odm->subscene->graph, event->size.width, event->size.height, 1);\r
+               break;\r
+       case GF_EVENT_KEYUP:\r
+               if ( (event->key.key_code == GF_KEY_I) && (event->key.flags & GF_KEY_MOD_CTRL)) {\r
+                       if (osd->visible->whichChoice==0) {\r
+                               osd->visible->whichChoice = -1;\r
+                               gf_cfg_set_key(osd->term->user->config, "OSD", "Visible", "no");\r
+                       } else {\r
+                               osd->visible->whichChoice = 0;\r
+                               gf_cfg_set_key(osd->term->user->config, "OSD", "Visible", "yes");\r
+                       }\r
+                       gf_node_dirty_set((GF_Node *) osd->visible, GF_SG_NODE_DIRTY, 1);\r
+               }\r
+               break;\r
+       }\r
+       return 0;\r
+}\r
+static Bool osd_process(GF_TermExt *termext, u32 action, void *param)\r
+{\r
+       const char *opt;\r
+       GF_OSD *osd = termext->udta;\r
+\r
+       switch (action) {\r
+       case GF_TERM_EXT_START:\r
+               osd->term = (GF_Terminal *) param;\r
+               opt = gf_modules_get_option((GF_BaseInterface*)termext, "OSD", "Enabled");\r
+               if (opt && strcmp(opt, "yes")) return 0;\r
+\r
+               /*load scene*/\r
+               if (! osd_load_scene(osd)) return 0;\r
+               /*attach scene to compositor*/\r
+               gf_sc_register_extra_graph(osd->term->compositor, osd->odm->subscene->graph, 0);\r
+\r
+\r
+               /*we are not threaded*/\r
+               termext->caps |= GF_TERM_EXTENSION_NOT_THREADED;\r
+\r
+               osd->refresh_time_ms = 500;\r
+               osd->evt_filter.on_event = osd_on_event_play;\r
+               osd->evt_filter.udta = osd;\r
+               gf_term_add_event_filter(osd->term, &osd->evt_filter);\r
+               return 1;\r
+\r
+       case GF_TERM_EXT_STOP:\r
+               osd->text->string.vals[0] = NULL;\r
+               /*remove scene to compositor*/\r
+               gf_sc_register_extra_graph(osd->term->compositor, osd->odm->subscene->graph, 1);\r
+               gf_odm_disconnect(osd->odm, 1);\r
+               osd->odm = NULL;\r
+\r
+               gf_term_remove_event_filter(osd->term, &osd->evt_filter);\r
+               osd->term = NULL;\r
+               break;\r
+\r
+       case GF_TERM_EXT_PROCESS:\r
+               /*flush all events until current time if reached*/\r
+               if (gf_sys_get_rti(osd->refresh_time_ms, &osd->rti, 0)) {\r
+                       sprintf(osd->statBuffer, "CPU %02d - FPS %02.2f - MEM %d KB", osd->rti.process_cpu_usage, gf_sc_get_fps(osd->term->compositor, 0), osd->rti.process_memory/1000);\r
+                       gf_node_dirty_set((GF_Node *) osd->text, GF_SG_NODE_DIRTY, 1);\r
+               }\r
+               break;\r
+       }\r
+       return 0;\r
+}\r
+\r
+\r
+GF_TermExt *osd_new()\r
+{\r
+       GF_TermExt *dr;\r
+       GF_OSD *osd;\r
+       dr = (GF_TermExt*)gf_malloc(sizeof(GF_TermExt));\r
+       memset(dr, 0, sizeof(GF_TermExt));\r
+       GF_REGISTER_MODULE_INTERFACE(dr, GF_TERM_EXT_INTERFACE, "GPAC OnSscreen Display", "gpac distribution");\r
+\r
+       GF_SAFEALLOC(osd, GF_OSD);\r
+       dr->process = osd_process;\r
+       dr->udta = osd;\r
+       return dr;\r
+}\r
+\r
+\r
+void osd_delete(GF_BaseInterface *ifce)\r
+{\r
+       GF_TermExt *dr = (GF_TermExt *) ifce;\r
+       GF_OSD *osd = dr->udta;\r
+       gf_free(osd);\r
+       gf_free(dr);\r
+}\r
+\r
+GF_EXPORT\r
+const u32 *QueryInterfaces() \r
+{\r
+       static u32 si [] = {\r
+               GF_TERM_EXT_INTERFACE,\r
+               0\r
+       };\r
+       return si; \r
+}\r
+\r
+GF_EXPORT\r
+GF_BaseInterface *LoadInterface(u32 InterfaceType) \r
+{\r
+       if (InterfaceType == GF_TERM_EXT_INTERFACE) return (GF_BaseInterface *)osd_new();\r
+       return NULL;\r
+}\r
+\r
+GF_EXPORT\r
+void ShutdownInterface(GF_BaseInterface *ifce)\r
+{\r
+       switch (ifce->InterfaceType) {\r
+       case GF_TERM_EXT_INTERFACE:\r
+               osd_delete(ifce);\r
+               break;\r
+       }\r
+}\r
index 9bed866183f54f8492f5f2cd2254f7ad1aa78d3b..fea5db4d6fe4ab1f21201def7bc75fa120c5d682 100644 (file)
@@ -2410,6 +2410,7 @@ void gf_sc_traverse_subscene(GF_Compositor *compositor, GF_Node *inline_parent,
                gf_mx_copy(mx_bck, tr_state->model_matrix);
 
                gf_mx_from_mx2d(&mx, &transf);
+
                /*copy over z scale*/
                mx.m[10] = mx.m[5];
                gf_mx_add_matrix(&tr_state->model_matrix, &mx);
@@ -2552,7 +2553,11 @@ static Bool gf_sc_on_event_ex(GF_Compositor *compositor , GF_Event *event, Bool
                }
                break;
        case GF_EVENT_SIZE:
-               /*resize message from plugin: if we own the output, resize*/
+               /*user consummed the resize event, do nothing*/
+               if ( gf_term_send_event(compositor->term, event) ) 
+                       return 1;
+
+               /*not consummed and compositor "owns" the output window (created by the output module), resize*/
                if (!compositor->user->os_window_handler) {
                        /*EXTRA CARE HERE: the caller (video output) is likely a different thread than the compositor one, and the
                        compositor may be locked on the video output (flush or whatever)!!
@@ -2569,11 +2574,7 @@ static Bool gf_sc_on_event_ex(GF_Compositor *compositor , GF_Event *event, Bool
                        }
                        if (lock_ok) gf_sc_lock(compositor, 0);
                }
-               /*otherwise let the user decide*/
-               else {
-                       return gf_term_send_event(compositor->term, event);
-               }
-               break;
+               return 0;
 
        case GF_EVENT_KEYDOWN:
        case GF_EVENT_KEYUP:
index 154dd5c2a238d0a4f4153572ef5f74c8f3fca768..4d7e66262e2075229db3fce6fed6b3f7d3d6096a 100644 (file)
@@ -910,6 +910,7 @@ void compositor_send_resize_event(GF_Compositor *compositor, GF_SceneGraph *subs
 {
 #ifndef GPAC_DISABLE_SVG
        GF_DOM_Event evt;
+       u32 i;
        GF_SceneGraph *scene = (subscene ? subscene : compositor->scene);
        GF_Node *root = gf_sg_get_root_node(scene);
        /*if root node is not DOM, sent a resize event (for VRML/BIFS). Otherwise this must be handled
@@ -950,6 +951,11 @@ void compositor_send_resize_event(GF_Compositor *compositor, GF_SceneGraph *subs
        }
        gf_dom_event_fire(gf_sg_get_root_node(scene), &evt);
 
+       i=0;
+       while ((scene = (GF_SceneGraph*)gf_list_enum(compositor->extra_scenes, &i))) {
+               gf_dom_event_fire(gf_sg_get_root_node(scene), &evt);
+       }
+
 #endif
 }
 void compositor_2d_set_user_transform(GF_Compositor *compositor, Fixed zoom, Fixed tx, Fixed ty, Bool is_resize)
index dfd09e5005b3b6d65ef9cb0b6ee61b8edf8561a0..4b507ae982e2d223c46aca690c07ffc51a4cf891 100644 (file)
@@ -52,10 +52,6 @@ static void TraverseSwitch(GF_Node *node, void *rs, Bool is_destroy)
                gf_free(st);
                return;
        }
-
-       if (gf_node_get_name(node)) {
-               node = node;
-       }
        /*WARNING: X3D/MPEG4 NOT COMPATIBLE*/
        switch (gf_node_get_tag(node)) {
        case TAG_MPEG4_Switch:
index e123df404dc666f99328868ae55d1722a9aea335..683d6161a2264d8fbbad8c1252eb688454045615 100644 (file)
@@ -136,8 +136,10 @@ void timesensor_update_time(GF_TimeNode *st)
                                return;
                        }
                }
-               TS->fraction_changed = newFraction;
-               gf_node_event_out(st->udta, 6);//"fraction_changed"
+               if (newFraction != TS->fraction_changed) {
+                       TS->fraction_changed = newFraction;
+                       gf_node_event_out(st->udta, 6);//"fraction_changed"
+               }
        }
 
        /*we're (about to be) active: VRML:
index a6dd17976791fa55ce83cb796e3a3db02c53e550..ba7efe3e35171a817f48d66d074f0181a59b81b8 100644 (file)
 #pragma comment (linker, EXPORT_SYMBOL(gf_sm_load_run) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_sm_load_suspend) )
 #pragma comment (linker, EXPORT_SYMBOL(gf_sm_import_bifs_subtitle) )
+#pragma comment (linker, EXPORT_SYMBOL(gf_sm_load_bt_from_string) )
 
 #ifndef GPAC_DISABLE_SCENE_ENCODER
 #pragma comment (linker, EXPORT_SYMBOL(gf_sm_encode_to_file) )
index 5722f9d30017dd960191f77917546e1703b28b8d..61abb0bda934cb3f1713b70edbfa2b1e422e2698 100644 (file)
@@ -223,6 +223,16 @@ static GF_Err gf_mpd_parse_rep_segmentinfo(GF_XMLNode *root, GF_MPD_Representati
                } else if (child->type == GF_XML_NODE_TYPE) {
                        if (!strcmp(child->name, "InitialisationSegmentURL")) {
                                gf_mpd_parse_rep_initseg(child, rep, rep->default_base_url);
+                       } else if (!strcmp(child->name, "BaseURL")) {
+                               /*ISO/IEC 23001-6 (19/07/2011), 5.5.11.2: "If [InitialisationSegmentURL@sourceURL]
+                                 not present, then any BaseURL element is mapped to the sourceURL"*/
+                               att_index = 0;
+                               while (att = gf_list_get(child->content, att_index)) {
+                                       if (att->value) {
+                                               rep->init_url = strdup(att->value);
+                                       }
+                                       att_index++;
+                               }
                        } else if (!strcmp(child->name, "UrlTemplate")) {
                                gf_mpd_parse_rep_urltemplate(child, rep);
                        } else if (!strcmp(child->name, "Url")) {
index e1718d1f9681b2abe9cfede5a706a8552a0be093..1c7968a1fc3d4e4e7df4c93426fa5cada81fb420 100644 (file)
@@ -912,15 +912,24 @@ const char *gf_esd_get_textual_description(GF_ESD *esd)
                                char *ext = strchr(esd->decoderConfig->decoderSpecificInfo->data + 4, '.');
                                if (!ext) return "GPAC Internal Scene Description";
                                ext += 1;
-                               if (!strnicmp(ext, "bt", 2)) return "BT Scene Description";
-                               if (!strnicmp(ext, "xmt", 2)) return "XMT Scene Description";
-                               if (!strnicmp(ext, "wrl", 3)) return "VRML Scene Description";
-                               if (!strnicmp(ext, "x3d", 3)) return "W3D Scene Description";
-                               if (!strnicmp(ext, "x3dv", 4)) return "X3D Scene Description";
-                               if (!strnicmp(ext, "swf", 3)) return "Flash (SWF) Scene Description";
-                               if (!strnicmp(ext, "xsr", 3)) return "LASeR-ML Scene Description";
-                               if (!strnicmp(ext, "wgt", 3)) return "W3C Widget Package";
-                               if (!strnicmp(ext, "mgt", 3)) return "MPEG-U Widget Package";
+                               if (!strnicmp(ext, "bt", 2))
+                                       return "BT Scene Description";
+                               if (!strnicmp(ext, "xmt", 2))
+                                       return "XMT Scene Description";
+                               if (!strnicmp(ext, "wrl", 3))
+                                       return "VRML Scene Description";
+                               if (!strnicmp(ext, "x3d", 3))
+                                       return "W3D Scene Description";
+                               if (!strnicmp(ext, "x3dv", 4))
+                                       return "X3D Scene Description";
+                               if (!strnicmp(ext, "swf", 3))
+                                       return "Flash (SWF) Scene Description";
+                               if (!strnicmp(ext, "xsr", 3))
+                                       return "LASeR-ML Scene Description";
+                               if (!strnicmp(ext, "wgt", 3))
+                                       return "W3C Widget Package";
+                               if (!strnicmp(ext, "mgt", 3))
+                                       return "MPEG-U Widget Package";
                        }
                        return "GPAC Internal Scene Description";
                case GPAC_OTI_PRIVATE_SCENE_SVG:
index 70e9f203a422d86d7ba9ff1fbbb44c43d9b47285..d991a14fd1d6b3185bc8e6c17acafa075eb243e0 100644 (file)
@@ -3660,7 +3660,7 @@ GF_Err gf_sm_load_init_bt(GF_SceneLoader *load)
 
 
 
-GF_List *gf_sm_load_bt_from_string(GF_SceneGraph *in_scene, char *node_str)
+GF_List *gf_sm_load_bt_from_string(GF_SceneGraph *in_scene, char *node_str, Bool force_wrl)
 {
        GF_SceneLoader ctx;
        GF_BTParser parser;
@@ -3674,7 +3674,7 @@ GF_List *gf_sm_load_bt_from_string(GF_SceneGraph *in_scene, char *node_str)
        parser.undef_nodes = gf_list_new();
        parser.def_nodes = gf_list_new();
        parser.peeked_nodes = gf_list_new();
-       parser.is_wrl = 1;
+       parser.is_wrl = force_wrl;
        gf_bt_loader_run_intern(&parser, NULL, 1);
        gf_list_del(parser.undef_nodes);
        gf_list_del(parser.def_nodes);
index 0c6d4a0f5ae031aa8af69f60d06257e58664399b..d7f05b173f1d85fedb63123cf54b375c30126a80 100644 (file)
@@ -996,7 +996,7 @@ static JSBool SMJS_FUNCTION(createVrmlFromString)
        GF_ScriptPriv *priv;
        GF_FieldInfo field;
        /*BT/VRML from string*/
-       GF_List *gf_sm_load_bt_from_string(GF_SceneGraph *in_scene, char *node_str);
+       GF_List *gf_sm_load_bt_from_string(GF_SceneGraph *in_scene, char *node_str, Bool force_wrl);
        char *str;
        GF_List *nlist;
        SMJS_ARGS
@@ -1005,7 +1005,7 @@ static JSBool SMJS_FUNCTION(createVrmlFromString)
 
        if (!JSVAL_IS_STRING(argv[0])) return JS_FALSE;
        str = SMJS_CHARS(c, argv[0]);
-       nlist = gf_sm_load_bt_from_string(sc_node->sgprivate->scenegraph, str);
+       nlist = gf_sm_load_bt_from_string(sc_node->sgprivate->scenegraph, str, 1);
        SMJS_FREE(c, str);
        if (!nlist) return JS_FALSE;
 
index 9f0e297a9523c08a33ac7a248ee4dc927c9e1455..19506b35fc9bd486a89507ad6f30c222da68f467 100644 (file)
@@ -316,6 +316,8 @@ static u32 MM_SimulationStep_Decoder(GF_Terminal *term)
                        gf_free(ce);
                        gf_list_rem(term->codecs, term->last_codec);
                        count--;
+                       if (!count)
+                               break;
                } else {
                        if (ce->dec->CB && (ce->dec->CB->UnitCount >= ce->dec->CB->Min)) ce->dec->PriorityBoost = 0;
                }
index 1e82aa0f9ebe6dacae37a0b4bc1fa5bfcb264881..77fdce5e34f8bac81a77969a6a1972c447a479ff 100644 (file)
@@ -87,7 +87,7 @@ static void term_on_connect(void *user_priv, GF_ClientService *service, LPNETCHA
 
                        /*destroy service only if attached*/
                        if (root) {
-                               gf_term_lock_net(term, 1);
+                               gf_mx_p(term->media_queue_mx);
                                service->ifce->CloseService(service->ifce);
                                root->net_service = NULL;
                                if (service->owner && service->nb_odm_users) service->nb_odm_users--;
@@ -97,7 +97,8 @@ static void term_on_connect(void *user_priv, GF_ClientService *service, LPNETCHA
                                        /*and queue for destroy*/
                                        gf_list_add(term->net_services_to_remove, service);
                                }
-                               gf_term_lock_net(term, 0);
+                               gf_mx_v(term->media_queue_mx);
+
                                if (!root->parentscene) {
                                        GF_Event evt;
                                        evt.type = GF_EVENT_CONNECT;
@@ -213,13 +214,13 @@ static void term_on_disconnect(void *user_priv, GF_ClientService *service, LPNET
        }
        /*this is service disconnect*/
        if (!netch) {
-               gf_term_lock_net(term, 1);
+               gf_mx_p(term->media_queue_mx);
                /*unregister from valid services*/
                if (gf_list_del_item(term->net_services, service)>=0) {
                        /*and queue for destroy*/
                        gf_list_add(term->net_services_to_remove, service);
                }
-               gf_term_lock_net(term, 0);
+               gf_mx_v(term->media_queue_mx);
                return;
        }
        /*this is channel disconnect*/
@@ -995,12 +996,16 @@ void gf_term_download_del(GF_DownloadSession * sess)
 
        /*avoid sending data back to user*/
        gf_dm_sess_abort(sess);
+
+       gf_mx_p(serv->term->media_queue_mx); 
+
        /*unregister from service*/
        gf_list_del_item(serv->dnloads, sess);
 
        /*same as service: this may be called in the downloader thread (typically when download fails)
        so we must queue the downloader and let the term delete it later on*/
        gf_list_add(serv->term->net_services_to_remove, sess);
+       gf_mx_v(serv->term->media_queue_mx); 
 }
 
 GF_EXPORT
index 66009aae06fc8f3570cbb0fbd5d136d22c6c1dce..7ff6164d84bee7d4de9c43664ed31b95c3e25e28 100644 (file)
@@ -214,7 +214,7 @@ void gf_odm_disconnect(GF_ObjectManager *odm, Bool do_remove)
                        }
                }
                odm->net_service = NULL;
-               if (!ns->nb_odm_users) gf_term_close_services(odm->term, ns);
+               if (!ns->nb_odm_users) gf_term_close_service(odm->term, ns);
        }
 
        gf_odm_lock(odm, 0);
@@ -705,7 +705,7 @@ void ODM_CheckChannelService(GF_Channel *ch)
        if (ch->service == ch->odm->net_service) return;
        /*if the stream has created a service check if close is needed or not*/
        if (ch->esd->URLString && !ch->service->nb_ch_users) 
-               gf_term_close_services(ch->odm->term, ch->service);
+               gf_term_close_service(ch->odm->term, ch->service);
 }
 
 /*setup channel, clock and query caps*/
index ebfdaab696d13d3c03000802ad4b8da258ecf418..44484ef121c440c6a25053aee1a23e3facdefa5e 100644 (file)
@@ -115,6 +115,8 @@ GF_Scene *gf_scene_new(GF_Scene *parentScene)
 
 void gf_scene_del(GF_Scene *scene)
 {
+       gf_mx_p(scene->root_od->term->net_mx);
+
        gf_list_del(scene->resources);
        assert(!gf_list_count(scene->extra_scenes) );
        gf_list_del(scene->extra_scenes);
@@ -171,6 +173,8 @@ void gf_scene_del(GF_Scene *scene)
        if (scene->dims_url.url) gf_free(scene->dims_url.url);
        if (scene->fragment_uri) gf_free(scene->fragment_uri);
        if (scene->redirect_xml_base) gf_free(scene->redirect_xml_base);
+
+       gf_mx_v(scene->root_od->term->net_mx);
        gf_free(scene);
 }
 
index d69dc46233a7f489374da9f0f2f08ae47ddc8104..3eb6d68c385719611073c44bd5c14104306afd8c 100644 (file)
@@ -559,6 +559,7 @@ GF_Terminal *gf_term_new(GF_User *user)
                GF_TermExt *ifce = (GF_TermExt *) gf_modules_load_interface(user->modules, i, GF_TERM_EXT_INTERFACE);
                if (ifce) gf_list_add(tmp->extensions, ifce);
        }
+
        tmp->unthreaded_extensions = gf_list_new();
        tmp->evt_mx = gf_mx_new("Event Filter");
 
@@ -627,6 +628,9 @@ GF_Err gf_term_del(GF_Terminal * term)
        gf_term_disconnect(term);
        GF_LOG(GF_LOG_DEBUG, GF_LOG_MEDIA, ("[Terminal] main service disconnected\n"));
 
+       /*signal we are being destroyed*/
+       term->reload_state = 3;
+
        /*wait for destroy*/
        e = GF_IO_ERR;
        timeout = 1000;
@@ -929,8 +933,10 @@ void gf_term_handle_services(GF_Terminal *term)
 
 
        while (gf_list_count(term->net_services_to_connect)) {
-               GF_ObjectManager *odm = (GF_ObjectManager *)gf_list_get(term->net_services_to_connect, 0);
-               GF_ClientService *ns = odm->net_service;
+               GF_ClientService *ns = (GF_ClientService*)gf_list_get(term->net_services_to_connect, 0);
+               GF_ObjectManager *odm = ns->owner;
+               assert(odm);
+
                gf_list_rem(term->net_services_to_connect, 0);
                /*unlock media queue before connecting*/
                gf_mx_v(term->media_queue_mx);
@@ -946,6 +952,9 @@ void gf_term_handle_services(GF_Terminal *term)
                gf_mx_p(term->media_queue_mx);
        }
 
+       /*!! media queue is still locked here*/
+
+
        /*play ODs that need it*/
        while (gf_list_count(term->media_queue)) {
                Bool destroy = 0;
@@ -996,31 +1005,31 @@ void gf_term_handle_services(GF_Terminal *term)
        gf_mx_v(term->media_queue_mx);
 
        /*lock to avoid any start attemps from compositor*/
-       if (!gf_mx_try_lock(term->compositor->mx)) 
-               return;
-       while (gf_list_count(term->net_services_to_remove)) {
-               gf_mx_p(term->net_mx);
-               ns = (GF_ClientService*)gf_list_get(term->net_services_to_remove, 0);
-               if (ns) gf_list_rem(term->net_services_to_remove, 0);
-               gf_mx_v(term->net_mx);
-               if (!ns) break;
-               gf_term_service_del(ns);
-       }
+       if (gf_mx_try_lock(term->compositor->mx)) {
+               while (gf_list_count(term->net_services_to_remove)) {
+                       gf_mx_p(term->net_mx);
+                       ns = (GF_ClientService*)gf_list_get(term->net_services_to_remove, 0);
+                       if (ns) gf_list_rem(term->net_services_to_remove, 0);
+                       gf_mx_v(term->net_mx);
+                       if (!ns) break;
+                       gf_term_service_del(ns);
+               }
 
-       if (term->nodes_pending) {
-               u32 i, count, n_count;
-               i=0;
-               count = gf_list_count(term->nodes_pending);
-               while (i<count) {
-                       GF_Node *n = (GF_Node *)gf_list_get(term->nodes_pending, i);
-                       gf_node_traverse(n, NULL);
-                       if (!term->nodes_pending) break;
-                       n_count = gf_list_count(term->nodes_pending);
-                       if (n_count==count) i++;
-                       else count=n_count;
+               if (term->nodes_pending) {
+                       u32 i, count, n_count;
+                       i=0;
+                       count = gf_list_count(term->nodes_pending);
+                       while (i<count) {
+                               GF_Node *n = (GF_Node *)gf_list_get(term->nodes_pending, i);
+                               gf_node_traverse(n, NULL);
+                               if (!term->nodes_pending) break;
+                               n_count = gf_list_count(term->nodes_pending);
+                               if (n_count==count) i++;
+                               else count=n_count;
+                       }
                }
+               gf_sc_lock(term->compositor, 0);
        }
-       gf_sc_lock(term->compositor, 0);
 
        /*extensions*/
        if (!term->reload_state && term->unthreaded_extensions) {
@@ -1070,23 +1079,30 @@ void gf_term_unqueue_node_traverse(GF_Terminal *term, GF_Node *node)
        gf_sc_lock(term->compositor, 0);
 }
 
-void gf_term_close_services(GF_Terminal *term, GF_ClientService *ns)
+void gf_term_close_service(GF_Terminal *term, GF_ClientService *ns)
 {
+       s32 idx;
        GF_Err e;
 
        /*prevent the media manager / term to access the list of services to destroy, otherwise
        we could unload the module while poping its CloseService() call stack which can lead to 
        random crashes (return adresses no longer valid) - cf any "stress mode" playback of a playlist*/
-       gf_mx_p(term->net_mx);
+       gf_mx_p(term->media_queue_mx);
        ns->owner = NULL;
-       e = ns->ifce->CloseService(ns->ifce);
+       idx = gf_list_find(term->net_services_to_connect, ns);
+       if (idx>=0) {
+               gf_list_rem(term->net_services_to_connect, idx);
+               e = GF_BAD_PARAM;
+       } else {
+               e = ns->ifce->CloseService(ns->ifce);
+       }
        /*if error don't wait for ACK to remove from main list*/
        if (e) {
                gf_list_del_item(term->net_services, ns);
                if (gf_list_find(term->net_services_to_remove, ns)<0)
                        gf_list_add(term->net_services_to_remove, ns);
        }
-       gf_mx_v(term->net_mx);
+       gf_mx_v(term->media_queue_mx);
 }
 
 void gf_term_lock_compositor(GF_Terminal *term, Bool LockIt)
@@ -1307,12 +1323,11 @@ void gf_term_connect_object(GF_Terminal *term, GF_ObjectManager *odm, char *serv
        odm->net_service->nb_odm_users++;
        gf_term_lock_net(term, 0);
 
-       ns = odm->net_service;
-
        gf_mx_p(term->media_queue_mx);
+       assert(odm->net_service->owner == odm);
        /*we are all set but we cannot assume it is safe to call connect from this thread, as this could be a
        script callback (JS locked) and connecting the media could trigger JS calls, which would deadlock*/
-       gf_list_add(term->net_services_to_connect, odm);
+       gf_list_add(term->net_services_to_connect, odm->net_service);
        
        gf_mx_v(term->media_queue_mx);
 }
index 45df7ea6d3a42ddf106ae205f4c539e7be1ccef1..802cdc73f1c70ac0e2aba5f7564273466e7b6647 100644 (file)
@@ -48,11 +48,12 @@ GF_EXPORT
 GF_ModuleManager *gf_modules_new(const char *directory, GF_Config *config)
 {
        GF_ModuleManager *tmp;
-        u32 loadedModules;
+       u32 loadedModules;
+       const char *opt;
        if (!directory || !strlen(directory) || (strlen(directory) > GF_MAX_PATH)){
-          GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("Cannot load modules from directory %s, sanity check fails.\n", directory));
-          return NULL;
-        }
+               GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("Cannot load modules from directory %s, sanity check fails.\n", directory));
+               return NULL;
+       }
        GF_SAFEALLOC(tmp, GF_ModuleManager);
        if (!tmp) return NULL;
        strcpy(tmp->dir, directory);
@@ -62,12 +63,16 @@ GF_ModuleManager *gf_modules_new(const char *directory, GF_Config *config)
 
        tmp->plug_list = gf_list_new();
        if (!tmp->plug_list) {
-                GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("OUT OF MEMORY, cannot create list of modules !!!\n", directory));
+               GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("OUT OF MEMORY, cannot create list of modules !!!\n", directory));
                gf_free(tmp);
                return NULL;
        }
        tmp->cfg = config;
-        loadedModules = gf_modules_refresh(tmp);
+       opt = gf_cfg_get_key(config, "Systems", "ModuleUnload");
+       if (opt && !strcmp(opt, "no")) {
+               tmp->no_unload = 1;
+       }
+       loadedModules = gf_modules_refresh(tmp);
        GF_LOG(GF_LOG_INFO, GF_LOG_CORE, ("Loaded %d modules from directory %s.\n", loadedModules, directory));
        return tmp;
 }
@@ -114,27 +119,27 @@ GF_BaseInterface *gf_modules_load_interface(GF_ModuleManager *pm, u32 whichplug,
        GF_BaseInterface *ifce;
 
        if (!pm){
-          GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("[Core] gf_modules_load_interface() : No Module Manager set\n"));
-          return NULL;
-        }
+               GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("[Core] gf_modules_load_interface() : No Module Manager set\n"));
+               return NULL;
+       }
        inst = (ModuleInstance *) gf_list_get(pm->plug_list, whichplug);
        if (!inst){
-          GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("[Core] gf_modules_load_interface() : no module %d exist.\n", whichplug));
-          return NULL;
-        }
-        GF_LOG(GF_LOG_DEBUG, GF_LOG_CORE, ("[Core] Load interface...%s\n", inst->name));
+               GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("[Core] gf_modules_load_interface() : no module %d exist.\n", whichplug));
+               return NULL;
+       }
+       GF_LOG(GF_LOG_DEBUG, GF_LOG_CORE, ("[Core] Load interface...%s\n", inst->name));
        /*look in cache*/
-        if (!pm->cfg){
-            GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("[Core] No pm->cfg has been set !!!\n"));
-            return NULL;
-        }
-        opt = gf_cfg_get_key(pm->cfg, "PluginsCache", inst->name);
+       if (!pm->cfg){
+               GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("[Core] No pm->cfg has been set !!!\n"));
+               return NULL;
+       }
+       opt = gf_cfg_get_key(pm->cfg, "PluginsCache", inst->name);
        if (opt) {
-                const char * ifce_str = gf_4cc_to_str(InterfaceFamily);
+               const char * ifce_str = gf_4cc_to_str(InterfaceFamily);
                snprintf(szKey, 32, "%s:yes", ifce_str ? ifce_str : "(null)");
                if (!strstr(opt, szKey)){
-                 return NULL;
-                }
+                       return NULL;
+               }
        }
        if (!gf_modules_load_library(inst)) {
                GF_LOG(GF_LOG_ERROR, GF_LOG_CORE, ("[Core] Cannot load library %s\n", inst->name));
index e9218ac9683c379f2cea4a327878572f64c5002e..a6d594f843dac7fa7aeb2dc9e396daaafcb732e5 100644 (file)
@@ -54,6 +54,7 @@ struct __tag_mod_man
        char dir[GF_MAX_PATH];
        GF_List *plug_list;
        GF_Config *cfg;
+       Bool no_unload;
        /*the one and only ssl instance used throughout the client engine*/
        void *ssl_inst;
 };
index 1f6997f849c5cb1eb05ef3607285b06d0fb78f4e..bd2595b9803d1e97c41d586ea4d923f6f8908eed 100644 (file)
@@ -140,6 +140,10 @@ Bool gf_modules_load_library(ModuleInstance *inst)
 void gf_modules_unload_library(ModuleInstance *inst)
 {
        if (!inst->lib_handle || gf_list_count(inst->interfaces)) return;
+       /*module unloading is disabled*/
+       if (inst->plugman->no_unload)
+               return;
+
 #ifdef WIN32
        FreeLibrary(inst->lib_handle);
 #else