Changeset 4 for trunk


Ignore:
Timestamp:
Jul 13, 2017, 5:17:57 AM (8 years ago)
Author:
stevenhl
Message:

Import modifications from cwmm-0_2_9-work-01_10_2006.zip dated 2006-08-27

Location:
trunk
Files:
110 added
89 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.inc

    r3 r4  
    1 BUILD_STRING = -Build 205 24/03/05
     1BUILD_STRING = -Build 235 12/02/06
  • trunk/changes-0_2_9.txt

    r3 r4  
    1 0.2.9:
     10.2.9pre2: (11.08.05)
     2-Close confirmation dialog of media folder will be dismissed automatically after 60s (use INI key to change)
     3-MM-find: app opens audio files in editor now (used to open default view and the folder)
     4-MM-find: video files are opened in player. No opening of the folder anymore
     5-MM-find: app loads NLV strings from resource DLL
     6-MM-find: query system for user added audio extensions for insertion into the search dialog
     7-MM-find: improved handling of image extensions
     8-MM-find: added to tasklist
     9-MM-find: added play controls for audio files
     10-MM-find: save last visited audio directory
     11-Helper apps (converter etc.) create their INI file in the users home directory now
     12-MMAudio class claimed to support *.wav extension while MMWAV should be the only one doing that (audioext.rx)
     13-MMVideo: associate extensions added by third party IO procs with it automatically (videoext.rx)
     14-MMVideo: defined type "Digital video"
     15-MMMPG: associate extensions added by OpenMPEG with it automatically (mpegext.rx)
     16-Improvements to the build process of the helper apps
     17-createcd.exe takes the name of created CD-folders from the resource DLL
     18-CWCDFolder: improved sorting (hope so, never saw problems on my system)
     19-CWCDFolder: No more hic up at start of track
     20-MM classes: fixed boot hangs because of endless loops in *.rx files under some circumstances
     21
     220.2.9pre1:
    223-Don't show a message box if resource DLL can't be found.
    324-Changed DLL finding algorithm. Should be more robust, when classes are improperly registered.
  • trunk/classes/REPLACE.CMD

    r3 r4  
    44'replace H:\cwmm\classes\Res\dll\mmres_DE.dll d:\MMOS2\MMCLASS\bin\mmres_DE.dll'
    55'replace H:\cwmm\classes\Res\dll\mmres_EN.dll d:\MMOS2\MMCLASS\bin\mmres_EN.dll'
     6'replace H:\cwmm\mediafolder\mediafolder.dll d:\MMOS2\MEDIAFLD\BIN\MEDIAFLD.DLL'
     7'replace H:\cwmm\mediafolder\res\obj\mediafolder_de.dll d:\MMOS2\MEDIAFLD\BIN\MFLDR_DE.DLL'
     8'del d:\MMOS2\MEDIAFLD\BIN\mediafld.hlp'
     9'copy H:\cwmm\mediafolder\help\mediafldr049.hlp d:\MMOS2\MEDIAFLD\BIN\mediafld.hlp'
     10
    611
    712'replace H:\cwmm\classes\cwmm.dll J:\MMOS2\CWMM\CWMM.DLL'
  • trunk/classes/bin/audioext.rx

    r2 r4  
    11/* rexx - Get the extension of audio types added using
    22   the multimedia setup object. For example *.FLA.
    3    This script is called by M_MMAudio.
     3   This script is called by M_MMAudio and mmfind.exe.
    44*/
    55
     
    88
    99allExt=""
     10waveaudio=""
    1011
    1112/* Get MMOS2 directory */
     
    6061        WHEN TRANSLATE(curExt)="FLA" THEN NOP
    6162        WHEN TRANSLATE(curExt)="FLAC" THEN NOP
     63        WHEN TRANSLATE(curExt)="WAV" THEN NOP
    6264
    6365        OTHERWISE
     
    8183        END
    8284        a=a+1
     85        IF a>mmini.0 THEN return
    8386END
    8487return
     
    99102                        END
    100103                        a=a+1
     104                        IF a>mmini.0 THEN return ""
    101105                END
    102106        END
    103107END
    104108return ""
    105 
  • trunk/classes/bin/chktimid.rx

    r2 r4  
    6161        END
    6262        a=a+1
     63        IF a>mmini.0 THEN return 0
    6364END
    6465return 0
  • trunk/classes/bin/imageadd.rx

    r2 r4  
    11/* rexx - Return additional image extensions the MMImage class
    2    should handle.   
    3    This script is called by M_MMImage.
     2   should handle.
     3   This script is called by M_MMImage and mmfind.exe.
    44*/
    55
     
    99EXIT
    1010
    11 
  • trunk/classes/bin/imageext.rx

    r2 r4  
    11/* rexx - Return all image extensions we have a MM class for.   
    2    This script is called by M_MMImage. After getting the extensions
     2   This script is called by M_MMImage and mmfind.exe. After getting the extensions
    33   M_MMImage checks if there're any additional extensions handled by
    44   installed image IO procedures. If yes, these unhandled extensions
     
    88
    99
    10 allExt="_IM DIB GIF JPG VID PCX PCD TIF TGA BMP"
     10allExt="*._IM,*.DIB,*.GIF,*.JPG,*.VID,*.PCX,*.PCD,*.TIF,*.TGA,*.BMP"
    1111return allExt
    1212EXIT
    1313
    14 
  • trunk/classes/c/c_audio/cwaudio.c

    r3 r4  
    7070char chrHelpLibrary[CCHMAXPATH]={0};
    7171char chrInstallDir[CCHMAXPATH]={0};
    72 char chrMMAudioExt[200]={0};/* Array holding the extensions for wpclsQueryInstanceFilter() */
     72char chrMMAudioExt[400]={0};/* Array holding the extensions for wpclsQueryInstanceFilter() */
    7373char resDLLPath[CCHMAXPATH]={0};
    7474
  • trunk/classes/c/c_common/helper.c

    r2 r4  
    11/*
    2  * This file is (C) Chris Wohlgemuth 2001/2004
     2 * This file is (C) Chris Wohlgemuth 2001-2005
    33 */
    44/*
     
    329329}
    330330
     331/* MMCLS_INI_FILE_NAME = "\\cwmm.ini" See ...\common.h */
    331332PSZ _queryMMClassIniFile(void)
    332333{
    333334  static char iniName[CCHMAXPATH]= {0};
    334335
    335   if(iniName[0]==0)
    336     sprintf(iniName, "%s\\bin\\CWMM.INI", queryInstallDir());
     336  if(iniName[0]==0) {
     337    /* Default is INI file in users home dir */
     338    if(SysQueryHomeDir(iniName, sizeof(iniName))) {
     339      strlcat(iniName, MMCLS_INI_FILE_NAME, sizeof(iniName)); /* MMCLS_INI_FILE_NAME = "\\CWMM.INI" */
     340      return iniName;
     341    }
     342
     343    sprintf(iniName, "%s\\bin%s", queryInstallDir(), MMCLS_INI_FILE_NAME);
     344  }
    337345
    338346  return iniName;
  • trunk/classes/c/c_image/cwimage.c

    r2 r4  
    19741974          /* This extension is yet unknown */
    19751975          if(chrMMImageExt[0]==0) {
     1976            /* It's the first one */
    19761977            sprintf(chrMMImageExt,"*.%s", pmmFormatInfoArray->szDefaultFormatExt);
    1977             //   fFirstExt=FALSE;
    19781978          }
    19791979          else {
    1980             strncat(chrMMImageExt,",*.",sizeof(chrMMImageExt)-1-strlen(chrMMImageExt));
    1981             strncat(chrMMImageExt, pmmFormatInfoArray->szDefaultFormatExt, sizeof(chrMMImageExt)-1-strlen(chrMMImageExt));
     1980            /* Check if the extension is not already added (e.g. TIF has a lot of subformats) */
     1981            if(!strstr(chrMMImageExt, pmmFormatInfoArray->szDefaultFormatExt)) {
     1982              strncat(chrMMImageExt,",*.",sizeof(chrMMImageExt)-1-strlen(chrMMImageExt));
     1983              strncat(chrMMImageExt, pmmFormatInfoArray->szDefaultFormatExt, sizeof(chrMMImageExt)-1-strlen(chrMMImageExt));
     1984            }
    19821985          }
    19831986          //          HlpWriteToTrapLog("Known Extension: %s\n", chrMMImageKnownExt);
  • trunk/classes/c/c_video/cwmpg.c

    r2 r4  
    11/*
    2  * (C) Chris Wohlgemuth 2002-2004
     2 * (C) Chris Wohlgemuth 2002-2005
    33 *
    44 */
     
    4141#include "helpid.h"
    4242#include "cwmpg.ih"
     43#include "cwaudioinc.h" /* For REXX script name */
     44#include "sys_funcs.h"
    4345
    4446extern char chrHelpLibrary[CCHMAXPATH];
     47char chrMMMPGExt[400]={0};/* Array holding the extensions for wpclsQueryInstanceFilter() */
    4548
    4649HMODULE queryResModuleHandle(void);
     
    4851BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
    4952ULONG launchPMProg(PSZ pszTitle, PSZ wrapperExe, PSZ parameters,  CWMMDataFile *thisPtr, ULONG ulView);
    50 
     53BOOL getStringFromRexxScript(PSZ rexxFile, char* chrResult, ULONG ulSize);
    5154
    5255/*
     
    155158    M_MMMPGMethodDebug("M_MMMPG","cwmpgM_wpclsQueryInstanceFilter");
    156159
    157     return "*.MPG,*.VBS";
     160    /* This list is build in wpclsInitData() */
     161    return chrMMMPGExt;
    158162}
    159163
     
    189193
    190194
     195SOM_Scope void  SOMLINK cwmpgM_wpclsInitData(M_MMMPG *somSelf)
     196{
     197  static BOOL bGotMPEGExt=FALSE;
     198
     199    /* M_MMMPGData *somThis = M_MMMPGGetData(somSelf); */
     200    M_MMMPGMethodDebug("M_MMMPG","cwmpgM_wpclsInitData");
     201
     202    /*
     203       Taken from the audio classes. I suspect the same is true for the video classes.
     204       Anyway it wont hurt having this here.
     205
     206       Get extensions of additional audio procs. These extensions may be specified by
     207       newly installed IO procs in MMPM2.INI or by using the Multimedia setup. For
     208       example the MMIOMP3 procedure for reading MP3 files adds the MP3 extension this
     209       way to the system. Extensions already handled by a specialized class will be
     210       filtered in the called REXX script e.g. MP3 so only unknown extensions end up here.
     211
     212       Strangely enough wpclsQueryInstanceFilter() is called during wpclsInitData() so
     213       we query the extensions here before calling the parent.
     214
     215       FIXME:
     216       The check is only done once during initialization. This is a little annoyance for
     217       the user because new extension specified in the settings will only be picked up
     218       on next WPS start.
     219       */
     220     if(!bGotMPEGExt)
     221      {
     222        /* REXX script: "mpegext.rx" */
     223        getStringFromRexxScript(MMMPG_GETEXT_RX, chrMMMPGExt, sizeof(chrMMMPGExt));
     224        /* Add our default extension *.MPG */
     225        if(chrMMMPGExt[0]==0)
     226          /* It's the first one */
     227          strcpy(chrMMMPGExt,"*.MPG,*.VBS");
     228        else
     229          strlcat(chrMMMPGExt, ",*.MPG,*.VBS", sizeof(chrMMMPGExt));
     230        bGotMPEGExt=TRUE;
     231      }
     232
     233    M_MMMPG_parent_M_MMVideo_wpclsInitData(somSelf);
     234}
     235
    191236/*
    192237 * SOM_Scope BOOL  SOMLINK cwmpgM_wpclsQueryDefaultHelp(M_CWMPG *somSelf,
  • trunk/classes/c/c_video/cwvideo.c

    r2 r4  
    11/*
    2  * (C) Chris Wohlgemuth 2002-2003
     2 * (C) Chris Wohlgemuth 2002-2005
    33 *
    44 */
     
    3939#include <os2.h>
    4040#include "cwvideo.ih"
     41#include "cwaudioinc.h" /* For REXX script name */
    4142//#include "cwmmres.h"
    4243//#include "mmres.h"
     
    4647BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
    4748ULONG launchPMProg(PSZ pszTitle, PSZ wrapperExe, PSZ parameters,  CWMMDataFile *thisPtr, ULONG ulView);
    48 
     49BOOL getStringFromRexxScript(PSZ rexxFile, char* chrResult, ULONG ulSize);
     50
     51char chrMMVideoExt[400]={0};/* Array holding the extensions for wpclsQueryInstanceFilter() */
    4952
    5053/*
     
    184187
    185188
     189SOM_Scope PSZ  SOMLINK cwvideoM_wpclsQueryInstanceType(M_MMVideo *somSelf)
     190{
     191  /*   static char chrTitle[40]={0}; */
     192    /* M_MMVideoData *somThis = M_MMVideoGetData(somSelf); */
     193    M_MMVideoMethodDebug("M_MMVideo","cwvideoM_wpclsQueryInstanceType");
     194
     195#if 0
     196    /* The type probably shouldn't be translated to make changing files between languages
     197       easier.*/
     198    if(chrTitle[0]==0)
     199      if(!getMessage(chrTitle, IDSTR_CWVIDEOTITLE, sizeof(chrTitle), queryResModuleHandle(), HWND_DESKTOP))
     200        strcpy(chrTitle,"Digital video");
     201#endif
     202    return TYPE_DIGITALVIDEO;
     203    /*  return (M_MMVideo_parent_M_CWMMDataFile_wpclsQueryInstanceType(somSelf)); */
     204}
     205
     206SOM_Scope PSZ  SOMLINK cwvideoM_wpclsQueryInstanceFilter(M_MMVideo *somSelf)
     207{
     208    /* M_MMVideoData *somThis = M_MMVideoGetData(somSelf); */
     209    M_MMVideoMethodDebug("M_MMVideo","cwvideoM_wpclsQueryInstanceFilter");
     210
     211    /* The list of additional extensions is built in wpclsInitData().
     212
     213       FIXME
     214       This is a static list read in only once during startup.
     215       Should probably be changed later on.
     216       */
     217    return chrMMVideoExt;
     218
     219    /* return (M_MMVideo_parent_M_CWMMDataFile_wpclsQueryInstanceFilter(somSelf)); */
     220}
     221
    186222/*
    187223 * SOM_Scope PSZ  SOMLINK cwvideoM_wpclsQueryTitle(M_CWVideo *somSelf)
     
    204240}
    205241
     242
     243SOM_Scope void  SOMLINK cwvideoM_wpclsInitData(M_MMVideo *somSelf)
     244{
     245  static BOOL bGotVideoExt=FALSE;
     246
     247    /* M_MMVideoData *somThis = M_MMVideoGetData(somSelf); */
     248    M_MMVideoMethodDebug("M_MMVideo","cwvideoM_wpclsInitData");
     249
     250    /*
     251       Taken from the audio classes. I suspect the same is true for the video classes.
     252       Anyway it wont hurt having this here.
     253
     254       Get extensions of additional audio procs. These extensions may be specified by
     255       newly installed IO procs in MMPM2.INI or by using the Multimedia setup. For
     256       example the MMIOMP3 procedure for reading MP3 files adds the MP3 extension this
     257       way to the system. Extensions already handled by a specialized class will be
     258       filtered in the called REXX script e.g. MP3 so only unknown extensions end up here.
     259
     260       Strangely enough wpclsQueryInstanceFilter() is called during wpclsInitData() so
     261       we query the extensions here before calling the parent.
     262
     263       FIXME:
     264       The check is only done once during initialization. This is a little annoyance for
     265       the user because new extension specified in the settings will only be picked up
     266       on next WPS start.
     267       */
     268     if(!bGotVideoExt)
     269      {
     270        /* REXX script: "videoext.rx" */
     271        getStringFromRexxScript(MMVIDEO_GETEXT_RX, chrMMVideoExt, sizeof(chrMMVideoExt));
     272        bGotVideoExt=TRUE;
     273      }
     274
     275    M_MMVideo_parent_M_CWMMDataFile_wpclsInitData(somSelf);
     276}
    206277
    207278/*
  • trunk/classes/idl/idl_video/cwmpg.idl

    r2 r4  
    131131    wpclsQueryInstanceFilter    : override;   
    132132    wpclsQueryIconData          : override;
     133    wpclsInitData               : override;
    133134    wpclsQueryDefaultHelp       : override;
    134135  };
  • trunk/classes/idl/idl_video/cwvideo.idl

    r2 r4  
    130130     */
    131131    wpclsCreateDefaultTemplates : override;
    132     wpclsQueryTitle             : override;   
    133     wpclsQueryDefaultView  : override;   
     132    wpclsQueryInstanceType      : override;
     133    wpclsQueryInstanceFilter    : override;
     134    wpclsQueryTitle             : override;
     135    wpclsInitData               : override;   
     136    wpclsQueryDefaultView       : override;   
    134137    wpclsQueryIconData          : override;
    135138  };
  • trunk/classes/inc/common.h

    r2 r4  
    6666#endif
    6767
     68#define MMCLS_INI_FILE_NAME     "\\cwmm.ini"
     69
    6870#endif
  • trunk/classes/inc/cwaudioinc.h

    r2 r4  
    6464#define TYPE_M3U             "M3U"
    6565#define TYPE_FLAC            "FLAC"
     66#define TYPE_DIGITALVIDEO    "Digital Video"
    6667
    6768/* Setup strings for MMAudio (was CWAudio). These strings will
     
    241242#define CLASS_VOLUME_KEY   "volume"
    242243
     244#define MMVIDEO_GETEXT_RX  "videoext.rx"
     245#define MMMPG_GETEXT_RX    "mpegext.rx"
     246
    243247#endif
    244248
  • trunk/classes/inc/mmres.h

    r2 r4  
    335335#define ID_MENUITEMMASTERVOLUME 5
    336336
    337 
     337#define IDPB_MMFINDSTOP             809
     338#define IDPB_MMFINDPAUSE            810
     339#define IDPB_MMFINDPLAY             811
  • trunk/classes/makefile

    r2 r4  
    1818IDLDIR  =       ./idl
    1919OBJDIR  =       ./obj
    20 # Object files of common functions are going here
     20
     21# Object files of common functions (CW functions) are going here
    2122LIBDIR  =       ./lib
    22 #Where the resource dlls are going
    23 RESDLLDIR       =       ./RES/dll
    2423
    2524
     
    2928#
    3029#######################################
     30
     31########### C compile #################
    3132COMPILE         =       $(CC) -I $(MOREINC) $(CFLAGS)  /Fo$@ $<
    3233
     34########### SOM compile ###############
    3335#Audio classes
    3436AUD_SCCOMPILEC  =       sc -I $(IDLDIR)/idl_audio -I $(IDLDIR)/idl_mm -p -r -sc -d$(CDIR)/c_audio -maddstar -mnoint -S128000 -C128000  $<
     
    114116
    115117
     118#######################################
     119#
     120# Define *.hlp files.
     121#
     122#######################################
    116123HLP_FILES       =       ./Help/de/cwmm049.hlp \
    117124                        ./Help/en/cwmm.hlp \
    118125                        ./Help/nl/cwmm031.hlp \
    119                         ./Help/it/cwmm039.hlp
     126                        ./Help/it/cwmm039.hlp \
     127                        ./Help/tw/cwmm088.hlp
    120128
    121129
     
    125133#
    126134#######################################
    127 MM_IHFILES      =       ./include/cwmmdataf.ih ./include/cwmmdisk.ih ./include/mmfolder.ih
    128 
    129 IHFILES =               ./include/cwmp3.ih \
     135MM_IHFILES      =       ./include/cwmmdataf.ih \
     136                        ./include/cwmmdisk.ih \
     137                        ./include/mmfolder.ih
     138
     139IHFILES         =       ./include/cwmp3.ih \
    130140                        ./include/cwogg.ih \
    131141                        ./include/cwaudio.ih \
     
    168178#
    169179#######################################
    170 all: cwmm.dll $(HLP_FILES)
     180all: cwmm.dll $(HLP_FILES) nlv
    171181        cd ./mm-progs && make
    172182
     
    176186cwmm.dll: $(MM_IHFILES) $(IHFILES) $(VID_IHFILES) $(IMG_IHFILES) \
    177187        $(ALL_OBJECTS)
    178         @create_cwmm_def.CMD ./c/cwmm.def
    179         $(CC) $(LDFLAGS) /L  /Fm$(basename $@)  /Fe$@ $(ALL_OBJECTS) $(LIBS) ./c/cwmm.def
    180 #Add icons to DLL
     188        @create_cwmm_def.CMD $(OBJDIR)/cwmm.def
     189        $(CC) $(LDFLAGS) /L  /Fm$(basename $@)  /Fe$@ $(ALL_OBJECTS) $(LIBS) $(OBJDIR)/cwmm.def
     190#Add icons to DLL (no NLV stuff)
    181191        cd ./res && make
    182192        rc ./res/common_res/cwaudio.res cwmm.dll
     
    185195###################################
    186196#
     197#  Rules for generating the NLV
     198#  ressources.
     199#
     200###################################
     201nlv:
     202        cd ./res && make
     203       
     204
     205###################################
     206#
    187207#  Rules for generating online help
    188208#
     
    203223./Help/it/cwmm039.hlp:  ./Help/it/cwmm039.ipf
    204224        cd ./Help/it && make
     225
     226# Traditional chinese (TW)
     227./Help/tw/cwmm088.hlp:  ./Help/tw/cwmm088.ipf
     228        cd ./Help/tw && make
    205229
    206230###################################
     
    293317        -cd ./Help/nl && make clean
    294318        -cd ./Help/it && make clean
     319        -cd ./Help/tw && make clean
    295320        -cd ./res && make clean
    296321        -cd ./mm-progs && make clean
     
    305330        -cd ./Help/nl && make cleaner
    306331        -cd ./Help/it && make cleaner
     332        -cd ./Help/tw && make cleaner
    307333        -cd ./res && make cleaner
    308334        -cd ./mm-progs && make cleaner
  • trunk/classes/mm-progs/MMPlayer/makefile

    r2 r4  
    22
    33include ../../../make.inc
     4include ../mmprog.inc
    45
    5 CC           = gcc
    6 LIB_DIR      = $d:/emx/lib
    7 #CPPFLAGS     = -Ge- /Gm+ -G4 -Gl  /O+ -Oc+ -Ol
    8 #CPPFLAGS     = -O -Zomf -Zcrtdll -Zmtd -s
    9 CPPFLAGS     = -O -Wall -Zomf -Zmt -Zsys -s
    10 INC             = ../include -I ../../../classes/inc -I ../../../common_functions/include
    11 DEFS         =
    12 PROGS        = 
    13 ODIR            = .
    14 CPPDIR  = .
    15 LIBDIR  =       ../lib
    16 OBJECTS =       $(LIBDIR)/message.obj $(LIBDIR)/helper.obj $(LIBDIR)/menu_funcs.obj $(LIBDIR)/sys_funcs.obj
     6OBJECTS =       $(LIBDIR)/message.obj \
     7                $(LIBDIR)/helper.obj \
     8                $(LIBDIR)/menu_funcs.obj \
     9                $(LIBDIR)/sys_funcs.obj
    1710OBJS2           =        customprocs.obj playaudio.obj display.obj
    1811
     
    2013all:    mmplayer.exe
    2114
    22 $(LIBDIR)/%.obj:        $(COMMONSRC)/%.c
    23         gcc -c -Wall -o$@ -Zomf -I$(INC) $< 
    2415
    25 %.obj:  %.c
    26         gcc -c -Wall -o$@ -Zomf -I$(INC) $< 
    27 
    28 mmplayer.exe:   mmplayer.c $(OBJECTS) $(OBJS2) makefile
     16mmplayer.exe:   mmplayer.c $(OBJECTS) $(OBJS2) makefile def.tpl
     17        cmd /C $(TOOLDIR)\create_MMPROG_def.cmd mmplayer.def
    2918#Use this command to link dynamicaly
    30         gcc $(CPPFLAGS) -I$(INC) mmplayer.c $(OBJECTS) $(OBJS2) -los2me mmplayer.def
     19        $(CC) $(CPPFLAGS) -I$(INC) mmplayer.c $(OBJECTS) $(OBJS2) -los2me mmplayer.def
    3120        rc mmplayer.rc mmplayer.exe
    3221
  • trunk/classes/mm-progs/MMPlayer/mmplayer.DEF

    r2 r4  
    1 ; DEF-file for mmplayer.exe. This is a PM program which
    2 ; play audio files.
    31;
    4 ;                    (C) Chris Wohlgemuth 2003
    5 
     2; MMPLAYER: PM-Program for audio file playing
     3;
     4;
     5;    (c) C. Wohlgemuth 2003-2005
     6;
     7;
     8; Created 14 Aug 2005 21:15:29
     9;
    610;/*
    711; * This program is free software; you can redistribute it and/or modify
     
    2630; */
    2731NAME MMPLAYER WINDOWAPI
    28 DESCRIPTION '$@#(c) Chris Wohlgemuth :V0.2.7 (17.08.2003)#@PM-Program for audio file playing'
     32DESCRIPTION '$@#(c) C. Wohlgemuth 2005:0.2        #@##1## 14/08/05 21:15:29        My ;-)     ::::9::@@PM-Program for audio file playing V0.2.9'
    2933STACKSIZE    1638400
    30 
    31 
    32 
    33 
  • trunk/classes/mm-progs/MMPlayer/playaudio.c

    r2 r4  
    294294  }
    295295}
     296
     297
  • trunk/classes/mm-progs/audioconverter/audconv.DEF

    r2 r4  
    1 ; DEF-file for audconv.exe. This is a PM program which
    2 ; shows a dialog box and converts audio files to waves.
    31;
    4 ;                    (C) Chris Wohlgemuth 2001
    5 
     2; AUDCONV: PM-Program for audio file converting
     3;
     4;
     5;    (c) C. Wohlgemuth 2001-2006
     6;
     7;
     8; Created 12 Feb 2006 19:46:31
     9;
    610;/*
    711; * This program is free software; you can redistribute it and/or modify
     
    2529; * http://www.geocities.com/SiliconValley/Sector/5785/
    2630; */
    27 
    28 NAME audconv WINDOWAPI
    29 DESCRIPTION '$@#(c) Chris Wohlgemuth :V0.2.7 (17.08.2003)#@PM-Program for audio file converting'
    30 
    31 
    32 
    33 
     31NAME AUDCONV WINDOWAPI
     32DESCRIPTION '$@#(c) C. Wohlgemuth 2006:0.2        #@##1## 12/02/06 19:46:31        My ;-)     ::::9::@@PM-Program for audio file converting V0.2.9'
     33STACKSIZE    1638400
  • trunk/classes/mm-progs/audioconverter/makefile

    r2 r4  
    33include ../../../make.inc
    44
    5 CC           = gcc
    6 LIB_DIR      = $d:/emx/lib
    7 #CPPFLAGS     = -Ge- /Gm+ -G4 -Gl  /O+ -Oc+ -Ol
    8 #CPPFLAGS     = -O -Zomf -Zcrtdll -s
    9 CPPFLAGS     = -O -Wall -Zomf -Zmt -Zsys -s
     5OBJECTS =       $(LIBDIR)/message.obj \
     6                $(LIBDIR)/helper.obj \
     7                $(LIBDIR)/progbars.obj \
     8                $(LIBDIR)/sys_funcs.obj
    109
    11 INC             = ../include -I ../../../classes/inc -I ../../../common_functions/include
    12 DEFS         =
    13 PROGS        = 
    14 ODIR            = .
    15 CPPDIR  = .
    16 LIBDIR  =       ../lib
    17 OBJECTS =       $(LIBDIR)/message.obj $(LIBDIR)/helper.obj $(LIBDIR)/progbars.obj $(LIBDIR)/sys_funcs.obj
     10include ../mmprog.inc
    1811
    1912
    2013all:    audconv.exe
    2114
    22 $(LIBDIR)/%.obj:        $(COMMONSRC)/%.c
    23         gcc -c -o$@ -Zomf -I$(INC) $< 
    2415
    25 audconv.exe:    audconv.c $(OBJECTS)
    26         gcc $(CPPFLAGS) -I$(INC) audconv.c $(OBJECTS) -los2me audconv.def
     16audconv.exe:    audconv.c $(OBJECTS) makefile def.tpl
     17        cmd /C $(TOOLDIR)\create_MMPROG_def.cmd audconv.def
     18        $(CC) $(CPPFLAGS) -I$(INC) audconv.c $(OBJECTS) -los2me audconv.def
    2719
    2820
    2921clean:
    3022        -rm *.exe
     23        -rm *.dll
    3124        -rm *.obj
     25        -rm *.res
     26        -rm *.ini
    3227
    3328cleaner:
     
    3833distribution:
    3934        -cp *.exe ../../dist/bin
    40        
    41 
  • trunk/classes/mm-progs/imageconverter/imgconv.DEF

    r2 r4  
    1 ; DEF-file for imgconv.exe. This is a PM program which
    2 ; shows a dialog box and converts image files.
    31;
    4 ;                    (C) Chris Wohlgemuth 2002
    5 
     2; IMGCONV: PM-Program for image file converting
     3;
     4;
     5;    (c) C. Wohlgemuth 2002-2006
     6;
     7;
     8; Created 12 Feb 2006 19:48:25
     9;
    610;/*
    711; * This program is free software; you can redistribute it and/or modify
     
    2529; * http://www.geocities.com/SiliconValley/Sector/5785/
    2630; */
    27 NAME imgconv WINDOWAPI
    28 DESCRIPTION '$@#(c) Chris Wohlgemuth :V0.2.7 (17.08.2003)#@PM-Program for image file converting'
     31NAME IMGCONV WINDOWAPI
     32DESCRIPTION '$@#(c) C. Wohlgemuth 2006:0.2        #@##1## 12/02/06 19:48:25        My ;-)     ::::9::@@PM-Program for image file converting V0.2.9'
    2933STACKSIZE    1638400
    30 
    31 
    32 
    33 
  • trunk/classes/mm-progs/imageconverter/makefile

    r2 r4  
    22
    33include ../../../make.inc
     4include ../mmprog.inc
    45
    5 CC           = gcc
    6 LIB_DIR      = $d:/emx/lib
    7 #CPPFLAGS     = -Ge- /Gm+ -G4 -Gl  /O+ -Oc+ -Ol
    8 #CPPFLAGS     = -O -Zomf -Zcrtdll -Zmtd -s
    9 CPPFLAGS     = -O -Wall -Zomf -Zmt -Zsys -s
    10 INC             = ../include -I ../../../classes/inc -I ../../../common_functions/include
    11 DEFS         =
    12 PROGS        = 
    13 ODIR            = .
    14 CPPDIR  = .
    15 LIBDIR  =       ../lib
    16 OBJECTS =       $(LIBDIR)/message.obj $(LIBDIR)/helper.obj $(LIBDIR)/progbars.obj $(LIBDIR)/sys_funcs.obj
     6OBJECTS =       $(LIBDIR)/message.obj \
     7                $(LIBDIR)/helper.obj \
     8                $(LIBDIR)/progbars.obj \
     9                $(LIBDIR)/sys_funcs.obj
    1710
    1811all:    imgconv.exe
    1912
    20 $(LIBDIR)/%.obj:        $(COMMONSRC)/%.c
    21         gcc -c -o$@ -Zomf -I$(INC) $< 
    2213
    2314imgconv.exe:    imgconv.c $(OBJECTS)
     15        cmd /C $(TOOLDIR)\create_MMPROG_def.cmd imgconv.def
    2416#Use this command to link dynamicaly
    25 #       gcc $(CPPFLAGS) -I$(INC) imgconv.c $(OBJECTS) -Zmtd -los2me imgconv.def
    26         gcc $(CPPFLAGS) -I$(INC) imgconv.c $(OBJECTS) -los2me imgconv.def
     17        $(CC) $(CPPFLAGS) -I$(INC) imgconv.c $(OBJECTS) -los2me imgconv.def
    2718
    2819clean:
    2920        -rm *.exe
     21        -rm *.dll
    3022        -rm *.obj
     23        -rm *.res
     24        -rm *.ini
    3125
    3226cleaner:
     
    3428        -rm *.flc
    3529
     30
    3631distribution:
    37        
    38 
  • trunk/classes/mm-progs/include/mmprogs_defaults.h

    r2 r4  
    2929/************************************/
    3030/* General */
    31 #define INI_FILE_NAME     "\\cwmm.ini"
     31#define MMCLS_INI_FILE_NAME     "\\cwmm.ini"
    3232#define INI_WINDOWPOS_KEY "windowpos"    /* Key for storing window position */
    3333
  • trunk/classes/mm-progs/master_volume/makefile

    r2 r4  
    22
    33include ../../../make.inc
     4include ../mmprog.inc
    45
    5 CC           = gcc
    6 LIB_DIR      = $d:/emx/lib
    7 #CPPFLAGS     = -Ge- /Gm+ -G4 -Gl  /O+ -Oc+ -Ol
    8 #CPPFLAGS     = -O -Zomf -Zcrtdll -s
    9 CPPFLAGS     = -O -Wall -Zomf -Zsys -s
    10 
    11 ICCFLAGS        = /Ss
    12 INC             = ../include -I ../../../common_functions/include -I ../../../classes/inc
    13 DEFS         =
    14 PROGS        = 
    15 ODIR            = .
    16 CPPDIR  = .
    176ICONDIR =       ..\res\Icons
    18 LIBDIR  =       ../lib
    19 OBJECTS =       $(LIBDIR)/message.obj $(LIBDIR)/helper.obj $(LIBDIR)/progbars.obj $(LIBDIR)/sys_funcs.obj
    20 #OBJDIR =       ../obj
     7OBJECTS =       $(LIBDIR)/message.obj \
     8                $(LIBDIR)/helper.obj \
     9                $(LIBDIR)/progbars.obj \
     10                $(LIBDIR)/sys_funcs.obj
    2111#OBJECTS        =       $(OBJDIR)/message.obj $(OBJDIR)/helper.obj $(OBJDIR)/progbars.obj \
    2212                        $(OBJDIR)/sys_funcs.obj
     
    2414all:    volume.exe
    2515
    26 $(LIBDIR)/%.obj:        $(COMMONSRC)/%.c
    27         gcc -c -o$@ -Zomf -I$(INC) $< 
    2816
    29 volume.exe:     volume.c $(OBJECTS)
    30         gcc $(CPPFLAGS) -I$(INC) volume.c $(OBJECTS) -Zmt -los2me volume.def
     17volume.exe:     volume.c $(OBJECTS) makefile def.tpl
     18        cmd /C $(TOOLDIR)\create_MMPROG_def.cmd volume.def
     19        $(CC) $(CPPFLAGS) -I$(INC) volume.c $(OBJECTS) -Zmt -los2me volume.def
    3120        rc -I $(INC) volume.rc volume.exe
    3221
  • trunk/classes/mm-progs/master_volume/volume.DEF

    r2 r4  
    1 ; DEF-file for volume.exe. This is a PM program which
    2 ; shows a dialog box for setting the masteraudio.
    31;
    4 ;                    (C) Chris Wohlgemuth 2001
    5 
     2; VOLUME: Master volume applet
     3;
     4;
     5;    (c) C. Wohlgemuth 2001-2006
     6;
     7;
     8; Created 12 Feb 2006 19:56:10
     9;
    610;/*
    711; * This program is free software; you can redistribute it and/or modify
     
    2529; * http://www.geocities.com/SiliconValley/Sector/5785/
    2630; */
    27 
    2831NAME VOLUME WINDOWAPI
    29 DESCRIPTION '$@#(c) Chris Wohlgemuth :V0.2.7 (17.08.2003)#@Master volume applet'
    30 ;EXPORTS         decodeStatusDialogProc
    31 
    32 
    33 
    34 
     32DESCRIPTION '$@#(c) C. Wohlgemuth 2006:0.2        #@##1## 12/02/06 19:56:10        My ;-)     ::::9::@@Master volume applet V0.2.9'
     33STACKSIZE    1638400
  • trunk/classes/mm-progs/mmfind/image.c

    r2 r4  
    9292}
    9393
    94 
    95 
    96 
    9794MRESULT EXPENTRY bmpPreviewProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    9895{
     
    116113
    117114
     115#if 0
    118116/*
    119117  Load an image file using IO-Procs
     
    378376    return(hbm);
    379377}
     378#endif
  • trunk/classes/mm-progs/mmfind/makefile

    r2 r4  
    22
    33include ../../../make.inc
     4include ../mmprog.inc
    45
    5 CC           = gcc
    6 LIB_DIR      = $d:/emx/lib
    7 #CPPFLAGS     = -Ge- /Gm+ -G4 -Gl  /O+ -Oc+ -Ol
    8 #CPPFLAGS     = -O -Zomf -Zcrtdll -Zmtd -s
    9 CPPFLAGS     = -O -Wall -Zomf -Zmt -Zsys -s
    10 INC             = ../include -I ../../../classes/inc -I ../../../common_functions/include
    11 DEFS         =
    12 PROGS        = 
    13 ODIR            = .
    14 CPPDIR  = .
    15 LIBDIR  =       ../lib
    16 OBJECTS =       $(LIBDIR)/helper.obj $(LIBDIR)/message.obj $(LIBDIR)/sys_funcs.obj
    17 # $(LIBDIR)/menu_funcs.obj
    18 OBJS2           =       image.obj       
    19 #customprocs.obj playaudio.obj display.obj
     6LIBOBJECTS      =       $(LIBDIR)/helper.obj \
     7                        $(LIBDIR)/message.obj \
     8                        $(LIBDIR)/sys_funcs.obj \
     9                        $(LIBDIR)/window_funcs.obj \
     10                        $(LIBDIR)/img_funcs.obj \
     11                        $(LIBDIR)/ini_funcs.obj
     12
     13
     14OBJECTS         =       image.obj       
    2015
    2116
    2217all:    mmfind.exe
    2318
    24 $(LIBDIR)/%.obj:        $(COMMONSRC)/%.c
    25         gcc -c -Wall -o$@ -Zomf -I$(INC) $< 
    26 
    27 %.obj:  %.c
    28         gcc -c -Wall -o$@ -Zomf -I$(INC) $< 
    29 
    30 mmfind.exe:     mmfind.c $(OBJECTS) $(OBJS2) makefile
     19mmfind.exe:     mmfind.c $(LIBOBJECTS) $(OBJECTS) makefile mmfind.rc def.tpl
    3120#Use this command to link dynamicaly
    32         gcc $(CPPFLAGS) -I$(INC) mmfind.c $(OBJECTS) $(OBJS2) -los2me mmfind.def
    33 #       rc mmfind.rc mmfind.exe
    34 
     21        cmd /C $(TOOLDIR)\create_MMPROG_def.cmd mmfind.def
     22        gcc $(CPPFLAGS) -I$(INC) mmfind.c $(LIBOBJECTS) $(OBJECTS) -los2me mmfind.def
     23        rc mmfind.rc mmfind.exe
    3524
    3625clean:
     
    4534        -rm *.flc
    4635
     36
    4737distribution:
    48        
  • trunk/classes/mm-progs/mmfind/mmfind.c

    r2 r4  
    11/*
    2  * mmplayer.c (C) Chris Wohlgemuth 2004
     2 * mmfind.c (C) Chris Wohlgemuth 2004-2005
    33 *
    44 */
     
    3737#define INCL_GPI
    3838#define INCL_PM
    39 
     39#define INCL_REXXSAA
     40
     41/* OS/2 and compiler includes */
    4042#include <os2.h>
    4143#include <sys\types.h>
     
    4547#include <stdlib.h>
    4648#include "os2me.h"
    47 #include "common.h"
    48 #include "mmres.h"
    49 #include "mmprogs_defaults.h"
     49/* CW toolkit includes */
    5050#include "sys_funcs.h"
    5151#include "message_funcs.h"
    52 
    53 #ifndef OPEN_DEFAULT
    54 /*  Open views for the wpOpen() method */
    55 
    56       #define OPEN_UNKNOWN      -1
    57       #define OPEN_DEFAULT       0
    58       #define OPEN_CONTENTS      1
    59       #define OPEN_SETTINGS      2
    60       #define OPEN_HELP          3
    61       #define OPEN_RUNNING       4
    62       #define OPEN_PROMPTDLG     5
    63       #define OPEN_PALETTE       121                                   /*SPLIT*/
    64       #define OPEN_USER          0x6500
    65 #endif
    66 
    67 #define TIMERID_SELECTION 1
    68 
     52#include "window_funcs.h"
     53#include "img_funcs.h"
     54#include "ini_funcs.h"
     55/* Program includes */
     56#include "common.h"
     57#include "mmres.h"                 /* Ressource IDs */
     58#include "mmprogs_defaults.h"
    6959//#define DEBUG
    70 #ifdef DEBUG
    71 void HlpWriteToTrapLog(const char* chrFormat, ...);
    72 #endif
    73 
    74 BOOL IniSaveWindowPos(char * iniFile, char* chrApp, char *chrKey, HWND hwnd);
    75 BOOL IniRestoreWindowPos(char * iniFile, char* chrApp, char *chrKey, HWND hwnd);
    76 int IniRestoreInt(char * iniFile, char* chrApp, char *chrKey, int defaultInt);
    77 BOOL IniSaveInt(char * iniFile, char* chrApp, char *chrKey, int theInt);
    78 BOOL HlpBuildMMProgIniFileName(char* chrProgname, char * chrBuffer, ULONG ulBufferSize);
    79 void freeResHandle();
    80 HMODULE queryResModuleHandle(char *chrExePath);
    81 BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
    82 MRESULT menuInsertMenuSeparator(HWND hwndMenu, HWND hwndSubMenu, SHORT sPosition );
    83 SHORT menuInsertMenuItem( HWND hwndMenu, HWND hwndSubMenu, SHORT sPosition, int iID, char * chrText);
    84 void pmUsage();
    85 ULONG messageBox( char* text, ULONG ulTextID , LONG lSizeText,
    86                   char* title, ULONG ulTitleID, LONG lSizeTitle,
    87                   HMODULE hResource, HWND hwnd, ULONG ulFlags);
    88 
    89 HBITMAP loadBitmap ( PSZ pszFileName, PBITMAPINFOHEADER2 pBMPInfoHeader2);
    90 VOID DrawBitmap ( HWND hwnd );
    91 MRESULT EXPENTRY bmpPreviewProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    92 void showImageControls(HWND hwnd, BOOL bShow);
    93 
    94 char logName[]="mmfind.log";
     60#include "mmfind.h"                /* mmfind specific defines */
     61
     62char logName[]="mmfind.log"; /* To keep some (unused) helpers in helper.c happy */
    9563
    9664char chrIniFile[CCHMAXPATH];
     65char chrInstallDir[CCHMAXPATH];
     66
     67char chrLastAudioDir[CCHMAXPATH];
     68char chrLastVideoDir[CCHMAXPATH];
     69char chrLastImageDir[CCHMAXPATH];
     70
     71/***** For previewing audio tracks *****/
     72char chrSourceName[CCHMAXPATH]; /* The audio file to be played */
     73BOOL bIsMidi=FALSE;             /* No MIDI support atm */
     74BOOL bIsPlaying=FALSE;          /* TRUE if currently playing */
     75BOOL bPaused=FALSE;             
     76ULONG ulPos;
     77ULONG ulTotalLength;
     78HWND hwndPlayer;                /* HWND of the player object window used for async coommunication */
     79
     80/***************************************/
    9781
    9882#define NUMPARAMS  1
     
    10589HMODULE RESSOURCEHANDLE=0;
    10690
    107 #define numMediaType 3
    108 #define MT_AUDIO 0
    109 #define MT_IMAGE 1
    110 #define MT_VIDEO 2
    111 #define MT_UNKNOWN 100
    112 
    113 char chrMediaFileTypes[numMediaType][100]= {"Audio","Image","Video"};
    114 char chrMediaFileExt[numMediaType][300]= {"*.AIF;*.AU;*.FLA;*.FLAC;*.IFF;*.MID;*.MP3;*.OGG;*.SND;*.VOC;*.WAV;*._AU",
     91char chrMediaFileTypes[NUMMEDIATYPES][100];
     92
     93char chrMediaFileExt[NUMMEDIATYPES][EXT_STRING_LENGTH]= {"*.AIF;*.AU;*.FLA;*.FLAC;*.IFF;*.MID;*.MP3;*.OGG;*.SND;*.VOC;*.WAV;*._AU",
     94                                          /* The image extensions are queried using the imageext.rx and imageadd.rx scripts */
    11595                                          "*.BMP;*.DIB;*.GIF;*.JPG;*.PCX;*.PNG;*.PCD;*.TIF;*.TGA;*.VID;*._IM",
    11696                                          "*.AVI;*.MPG;*.FLI;*.FLC;*.MOV;*.QT;*.VBS"};
     97/* Additional audio extensions to be queried during runtime */
     98char chrAdditionalExt[200];
     99/* This holds the template used when building the audio information text */
     100char audioText[255];
     101
    117102int iMediaType=MT_AUDIO;
    118103
    119 char audioText[1000]={"Play time:\t%02d:%02d\n\nSamplerate:\t%d\n\nBits per sample:\t%d\n\nChannels:\t%d"};
    120 
    121 HAB globalHab;
    122 
    123 /* BMP info for preview */
     104/* BMP stuff for preview */
    124105BITMAPINFOHEADER2 bmpInfoHeader2;
    125106HBITMAP hBitmap;
    126107
     108/* HBITMAP for the play control buttons */
     109HBITMAP hbmPlay;
     110HBITMAP hbmStop;
     111
    127112FILEDLG fd = { 0 };
    128113
    129 void loadStrings(void)
    130 {
    131 
    132 }
    133 
    134 void showVideoControls(HWND hwnd, BOOL bShow)
     114static void _loadButtonBmps()
     115{
     116  HPS hps;
     117  HMODULE hResource;
     118
     119  hResource=NULLHANDLE;
     120  hps=WinGetPS(HWND_DESKTOP);
     121
     122  /* Play */ 
     123  hbmPlay=GpiLoadBitmap(hps, hResource, IDBMP_PLAY, 0, 0);
     124
     125  /* Stop */
     126  hbmStop=GpiLoadBitmap(hps, hResource, IDBMP_STOP, 0, 0);
     127
     128  WinReleasePS(hps);
     129}
     130
     131static void changeButtons(HWND hwnd)
     132{
     133  HWND hwndTemp;
     134  BTNCDATA btCtrl;
     135  WNDPARAMS wndParams;
     136  ULONG ulStyle;
     137
     138  if(hbmPlay) {
     139    hwndTemp=WinWindowFromID(hwnd, IDPB_MMFINDPLAY);
     140
     141    /* Change Style to bitmap */
     142    ulStyle=WinQueryWindowULong(hwndTemp,QWL_STYLE);
     143    ulStyle|=(BS_BITMAP);
     144    ulStyle&=~BS_TEXT;
     145   
     146    if(WinSetWindowULong(hwndTemp, QWL_STYLE, ulStyle)) {
     147      memset(&btCtrl, 0, sizeof(btCtrl));
     148      btCtrl.cb=sizeof(btCtrl);
     149      btCtrl.hImage=hbmPlay;
     150      memset(&wndParams, 0, sizeof(wndParams));
     151      wndParams.fsStatus=WPM_CTLDATA;
     152      wndParams.cbCtlData=btCtrl.cb;
     153      wndParams.pCtlData=&btCtrl;
     154      WinSendMsg(hwndTemp,WM_SETWINDOWPARAMS,
     155                 MPFROMP(&wndParams),0);
     156    }
     157  }
     158
     159  if(hbmStop) {
     160    hwndTemp=WinWindowFromID(hwnd, IDPB_MMFINDSTOP);
     161    /* Change Style to bitmap */
     162    ulStyle=WinQueryWindowULong(hwndTemp,QWL_STYLE);
     163    ulStyle|=(BS_BITMAP);
     164    ulStyle&=~BS_TEXT;
     165   
     166    if(WinSetWindowULong(hwndTemp, QWL_STYLE, ulStyle)) {
     167      memset(&btCtrl, 0, sizeof(btCtrl));
     168      btCtrl.cb=sizeof(btCtrl);
     169      btCtrl.hImage=hbmStop;
     170      memset(&wndParams, 0, sizeof(wndParams));
     171      wndParams.fsStatus=WPM_CTLDATA;
     172      wndParams.cbCtlData=btCtrl.cb;
     173      wndParams.pCtlData=&btCtrl;
     174      WinSendMsg(hwndTemp,WM_SETWINDOWPARAMS,
     175                 MPFROMP(&wndParams),0);
     176    }
     177  }
     178}
     179
     180static char* translateChars(char * chrString, char chrFrom, char chrTo)
     181{
     182  char *chr=chrString;
     183
     184  if(chrTo == '\0' || chrFrom=='\0'|| chrString==NULLHANDLE)
     185    return NULLHANDLE;
     186
     187  while(*chr)
     188    {
     189      if(*chr==chrFrom)
     190        *chr=chrTo;
     191
     192      chr++;
     193    }
     194  return chrString;
     195}
     196
     197static void loadStringsFromResourceDLL(HMODULE hResMod)
     198{
     199  if(!MsgGetMessage(audioText, IDSTR_AUDIOINFOTEXT, sizeof(audioText), hResMod,HWND_DESKTOP))
     200    strcpy(audioText, TEXT_INFOTEXT);
     201  if(!MsgGetMessage(chrMediaFileTypes[MT_AUDIO], IDSTR_TYPEAUDIO,
     202                 sizeof(chrMediaFileTypes[MT_AUDIO]), hResMod, HWND_DESKTOP))
     203    strcpy(chrMediaFileTypes[MT_AUDIO], TEXT_TYPEAUDIO);
     204  if(!MsgGetMessage(chrMediaFileTypes[MT_IMAGE], IDSTR_TYPEIMAGE,
     205                 sizeof(chrMediaFileTypes[MT_IMAGE]), hResMod, HWND_DESKTOP))
     206    strcpy(chrMediaFileTypes[MT_AUDIO], TEXT_TYPEIMAGE);
     207  if(!MsgGetMessage(chrMediaFileTypes[MT_VIDEO], IDSTR_TYPEVIDEO,
     208                 sizeof(chrMediaFileTypes[MT_VIDEO]), hResMod, HWND_DESKTOP))
     209    strcpy(chrMediaFileTypes[MT_VIDEO], TEXT_TYPEVIDEO);
     210}
     211
     212static void showVideoControls(HWND hwnd, BOOL bShow)
    135213{
    136214  /* Preview area */
     
    140218}
    141219
     220
     221static void enableAudioPlayControls(HWND hwnd, BOOL bEnable)
     222{
     223    WinEnableWindow(WinWindowFromID(hwnd, IDPB_MMFINDPAUSE), bEnable);
     224    WinEnableWindow(WinWindowFromID(hwnd, IDPB_MMFINDPLAY), bEnable);
     225    WinEnableWindow(WinWindowFromID(hwnd, IDPB_MMFINDSTOP), bEnable);
     226}
     227
    142228void showAudioControls(HWND hwnd, BOOL bShow)
    143229{
     
    146232  /* Group box */
    147233  WinShowWindow(WinWindowFromID(hwnd, IDGB_AUDIOINFO), bShow);
    148 }
    149 
    150 
    151 ULONG mmIdentifyFile(char* chrFile)
     234  /* Playcontrols */
     235  WinShowWindow(WinWindowFromID(hwnd, IDPB_MMFINDPLAY), bShow);
     236  WinShowWindow(WinWindowFromID(hwnd, IDPB_MMFINDSTOP), bShow);
     237  WinShowWindow(WinWindowFromID(hwnd, IDPB_MMFINDPAUSE), bShow);
     238  if(bShow) {
     239    WinSetWindowToTop(WinWindowFromID(hwnd, IDPB_MMFINDPAUSE));
     240    WinSetWindowToTop(WinWindowFromID(hwnd, IDPB_MMFINDPLAY));
     241    WinSetWindowToTop(WinWindowFromID(hwnd, IDPB_MMFINDSTOP));
     242    enableAudioPlayControls(hwnd, FALSE);
     243  }
     244}
     245
     246BOOL pauseAudioFile(HWND hwndNotify)
     247{
     248#if 0
     249  char chrCommand[50];
     250  char retMsg[100];
     251  ULONG rc;
     252
     253  iWavePriv=ulPid;
     254
     255  if(bPaused) {
     256    sprintf(chrCommand,"RESUME wave%d wait", hwndNotify);
     257    rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     258    bPaused=FALSE;
     259    showPlayTimeDisplay( hwndFrame, TRUE);
     260  }
     261  else {
     262    sprintf(chrCommand,"PAUSE wave%d wait", iWavePriv);
     263    rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     264    bPaused=TRUE;
     265  }
     266#endif
     267  return TRUE;
     268}
     269
     270BOOL stopAudioFile(HWND hwndNotify)
     271{
     272  char chrCommand[50];
     273  char retMsg[100];
     274  ULONG rc;
     275
     276  if(bIsPlaying) {
     277    sprintf(chrCommand,"stop wave%ld wait", hwndNotify);
     278    rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     279   
     280    sprintf(chrCommand,"close wave%ld wait", hwndNotify);
     281    rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     282
     283#if 0   
     284    _resetDisplay(hwndFrame);
     285    showPlayTimeDisplay( hwndFrame, TRUE);
     286    WinStopTimer(WinQueryAnchorBlock(hwndFrame), hwndFrame, IDTIMER_PLAY);
     287#endif
     288    bIsPlaying=FALSE;
     289    bPaused=FALSE; 
     290  }
     291
     292  return TRUE;
     293}
     294
     295ULONG playAudioFile(HWND hwndFrame)
     296{
     297  char chrCommand[CCHMAXPATH*2];
     298  char chrDevice[30];
     299  char retMsg[20];
     300  ULONG rc;
     301  int iTime2;
     302  HWND hwndNotify;
     303
     304  hwndNotify=hwndFrame;//WinWindowFromID(hwndTop, IDDLG_TOPMIDDLE);
     305
     306  if(bPaused)
     307    {
     308      pauseAudioFile(hwndFrame);
     309      return 1;
     310    }
     311
     312  ulPos=0;
     313
     314  stopAudioFile(hwndFrame);
     315
     316  if(bIsMidi)
     317    strncpy(chrDevice,"SEQUENCER", sizeof(chrDevice));
     318  else
     319    strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice));
     320
     321  /* Start audio file */ 
     322  sprintf(chrCommand,"open \"%s\"  type %s alias wave%ld SHAREABLE wait", chrSourceName, chrDevice, hwndNotify);
     323
     324
     325  rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), hwndNotify, 0);
     326  if((rc & 0x0000ffff)!=MCIERR_SUCCESS)
     327    return 0;
     328 
     329  /* Set time format */
     330  sprintf(chrCommand,"SET wave%ld TIME FORMAT MILLISECONDS wait", hwndNotify);
     331  rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     332  if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
     333    sprintf(chrCommand,"close wave%ld wait", hwndNotify);
     334    rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     335    return 0;
     336  }     
     337
     338#if 0
     339  sprintf(chrCommand,"SETPOSITIONADVISE wave%d ON EVERY 1000 notify", iWavePriv);
     340  rc = mciSendString(chrCommand, retMsg, sizeof(retMsg),hwndNotify, 0);
     341  if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
     342    sprintf(chrCommand,"close wave%d wait",iWavePriv);
     343    rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     344    return 0;
     345  }
     346#endif
     347
     348  /* Get wave length in ms */
     349  iTime2=0;
     350  sprintf(chrCommand,"STATUS wave%ld LENGTH WAIT", hwndNotify);
     351  rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     352  if((rc & 0x0000ffff)==MCIERR_SUCCESS) {
     353    iTime2=atoi(retMsg);
     354    sprintf(chrCommand,"%d:%02d  %d:%02d  -%d:%02d",iTime2/1000/60,(iTime2/1000)%60,
     355            0, 0,
     356            iTime2/1000/60,(iTime2/1000)%60);
     357  }
     358  ulTotalLength=iTime2;
     359
     360#if 0
     361  /* Set volume */
     362  sprintf(chrCommand,"SET wave%ld AUDIO VOLUME %ld wait", hwndFrame, ulVolume);
     363  rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     364  if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
     365    sprintf(chrCommand,"close wave%d",iWavePriv);
     366    rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     367    return 0;
     368  }
     369#endif
     370
     371  sprintf(chrCommand,"play wave%ld FROM 0", hwndNotify);
     372  rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     373  if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
     374    sprintf(chrCommand,"close wave%ld", hwndNotify);
     375    rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     376    return 0;
     377  }
     378
     379#if 0
     380  WinStartTimer(WinQueryAnchorBlock(hwndFrame), hwndFrame, IDTIMER_PLAY, PLAYTIMER_DELAY);
     381#endif
     382
     383  bIsPlaying=TRUE;
     384
     385  return 1;
     386}
     387
     388static MRESULT EXPENTRY playObjectProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     389{
     390  switch (msg)
     391    {
     392    case WM_APPTERMINATENOTIFY:
     393      {
     394
     395        HWND hwndFrame=HWNDFROMMP(mp2);
     396        switch(LONGFROMMP(mp1))
     397          {
     398          case PLAY_FILE:
     399            playAudioFile(hwndFrame);
     400            break;
     401          case STOP_TRACK:
     402            stopAudioFile(hwndFrame);
     403            break;
     404          case PAUSE_TRACK:
     405            pauseAudioFile(hwndFrame);
     406            break;
     407          default:
     408            break;
     409          }
     410        return (MRESULT)0;
     411      }
     412    case WM_CLOSE:
     413
     414      break;
     415    default:
     416      break;
     417    }
     418  return WinDefWindowProc( hwnd, msg, mp1, mp2);
     419}
     420
     421/* Every folder has one running play thread to handle play commands */
     422void _Optlink playThreadFunc (void *arg)
     423{
     424  HAB  hab;
     425  HMQ  hmq;
     426  QMSG qmsg;
     427  HWND hwndNotify=(HWND)arg;
     428
     429  hab=WinInitialize(0);
     430  if(hab) {
     431    hmq=WinCreateMsgQueue(hab,0);
     432    if(hmq) {
     433      HWND hwndPlayObject;
     434      hwndPlayObject=WinCreateWindow(HWND_OBJECT,WC_STATIC,"MMAudioPlayObj",
     435                                     0,0,0,0,0,NULLHANDLE,HWND_BOTTOM,13343,NULL,NULL);
     436      if(hwndPlayObject) {
     437        WinSubclassWindow(hwndPlayObject,&playObjectProc);
     438        /* Window created. */
     439        WinPostMsg(hwndNotify, WM_APPTERMINATENOTIFY, MPFROMSHORT(MMAUDIO_PLAYER_CREATED),
     440                   MPFROMHWND(hwndPlayObject));
     441        while(WinGetMsg(hab,&qmsg,(HWND)NULL,0,0))
     442          WinDispatchMsg(hab,&qmsg);
     443
     444        WinDestroyWindow(hwndPlayObject);
     445      }
     446      WinDestroyMsgQueue(hmq);
     447    }
     448    WinTerminate(hab);
     449  }
     450}
     451
     452
     453void MMAudioPlayFile(HWND hwndPlayer, HWND hwndNotify, char* chrFile)
     454{
     455  WinPostMsg(hwndPlayer, WM_APPTERMINATENOTIFY, MPFROMSHORT(PLAY_FILE), MPFROMHWND(hwndNotify));
     456}
     457
     458void MMAudioStop(HWND hwndPlayer, HWND hwndNotify)
     459{
     460  WinPostMsg(hwndPlayer, WM_APPTERMINATENOTIFY, MPFROMSHORT(STOP_TRACK), MPFROMHWND(hwndNotify));
     461}
     462
     463void MMAudioPause(HWND hwndPlayer, HWND hwndNotify)
     464{
     465  WinPostMsg(hwndPlayer, WM_APPTERMINATENOTIFY, MPFROMSHORT(PAUSE_TRACK), MPFROMHWND(hwndNotify));
     466}
     467
     468BOOL MMAudioOpenPlayer(HWND hwndNotify)
     469{
     470  if(-1==_beginthread(playThreadFunc,NULL,8192*16, (void*)hwndNotify))
     471    return FALSE; /* Error occured */
     472
     473  return TRUE;
     474}
     475
     476void MMAudioClosePlayer(HWND hwndPlayer)
     477{
     478  WinSendMsg(hwndPlayer, WM_QUIT, 0, 0);
     479  return;
     480}
     481
     482static ULONG mmIdentifyFile(char* chrFile)
    152483{
    153484  MMIOINFO mmioInfo={0};
     
    155486  FOURCC fourCC;
    156487
    157   //  SysWriteToTrapLog("%s\n", chrFile);
    158488  if(MMIO_SUCCESS!=mmioIdentifyFile(chrFile, &mmioInfo, &mmFormatInfo, &fourCC, 0,0))
    159489    {
     
    178508}
    179509
     510static PSZ queryExeDir(const char *chrEXE)
     511{
     512  if(chrInstallDir[0]==0)
     513    {
     514      char * chr;
     515      strlcpy(chrInstallDir, chrEXE, sizeof(chrInstallDir));
     516      if((chr=strrchr(chrInstallDir, '\\'))!=NULLHANDLE)
     517        *chr='\0';
     518    }
     519  return chrInstallDir;
     520}
     521
    180522
    181523MRESULT findFileDlgProc(HWND hwnd, ULONG  msg, MPARAM mp1, MPARAM mp2)
     
    187529      {
    188530        int a;
     531        SWCNTRL swctl;
     532        PID pid;
    189533
    190534        /* Set dialog font */
     
    195539        }
    196540        /* Fill combo box with media types (audio, image, video) */
    197         for(a=0;a<numMediaType;a++)
     541        for(a=0;a<NUMMEDIATYPES;a++)
    198542          WinSendMsg(WinWindowFromID(hwnd, IDCB_TYPEOFFILE), LM_INSERTITEM, MRFROMSHORT(LIT_SORTASCENDING),
    199543                     MPFROMP(chrMediaFileTypes[a]));
     
    202546        /* Subclass preview area */
    203547        WinSubclassWindow(WinWindowFromID(hwnd, IDSR_IMGPREVIEW), bmpPreviewProc);
     548
     549        /* Add switch entry */
     550        memset(&swctl,0,sizeof(swctl));
     551        WinQueryWindowProcess(hwnd,&pid,NULL);
     552        swctl.hwnd=hwnd;
     553        swctl.uchVisibility=SWL_VISIBLE;
     554        swctl.idProcess=pid;
     555        swctl.bProgType=PROG_DEFAULT;
     556        swctl.fbJump=SWL_JUMPABLE;
     557        WinAddSwitchEntry(&swctl);
     558
     559        /* Add bitmap to play control buttons */
     560        changeButtons(hwnd);
     561
     562        /* Start an audio player thread */
     563        MMAudioOpenPlayer(hwnd);
    204564        break;
     565      }
     566    case WM_APPTERMINATENOTIFY:
     567      {
     568        /* Posted from player object window */
     569        switch(SHORT1FROMMP(mp1))
     570          {
     571          case MMAUDIO_PLAYER_CREATED:
     572            /* Player object window */
     573            hwndPlayer=HWNDFROMMP(mp2);
     574            break;
     575          default:
     576            break;
     577          }
     578        return MRFALSE;
    205579      }
    206580    case WM_CONTROL:
     
    215589                WinQueryWindowText(HWNDFROMMP(mp2), sizeof(chrText), chrText);
    216590                /* Find Index */
    217                 for(a=0; a<numMediaType;a++) {
     591                for(a=0; a<NUMMEDIATYPES;a++) {
    218592                  if(!stricmp(chrMediaFileTypes[a], chrText))
    219593                    break;
     
    234608                    showVideoControls(hwnd, FALSE);
    235609                    showImageControls(hwnd, TRUE);
    236                       iMediaType=MT_IMAGE;
     610                    iMediaType=MT_IMAGE;
    237611                    break;
    238612                  case 2:
     
    249623                WinSendMsg(WinWindowFromID(hwnd, 258), WM_CHAR,
    250624                           MPFROM2SHORT(KC_VIRTUALKEY , 0), MPFROM2SHORT(0, VK_NEWLINE));
    251 
    252625              }
    253626            break;
     
    256629            {
    257630              if(SHORT2FROMMP(mp1)==EN_CHANGE)
    258                 WinStartTimer(globalHab, hwnd, TIMERID_SELECTION, 100);
     631                WinStartTimer(WinQueryAnchorBlock(HWND_DESKTOP), hwnd, TIMERID_SELECTION, 100);
    259632              break;
    260633            }
     
    272645            char chrFullName[CCHMAXPATH*2];
    273646
    274             WinStopTimer(globalHab, hwnd, TIMERID_SELECTION);
     647            WinStopTimer(WinQueryAnchorBlock(HWND_DESKTOP), hwnd, TIMERID_SELECTION);
    275648            WinQueryWindowText(WinWindowFromID(hwnd, 258), sizeof(chrName), chrName);
    276649            strcpy(chrFullName, fd.szFullFile);
     650            switch(iMediaType)
     651              {
     652              case MT_AUDIO:
     653                strlcpy(chrLastAudioDir, fd.szFullFile, sizeof(chrLastAudioDir));
     654                break;
     655              case MT_IMAGE:
     656                strlcpy(chrLastImageDir, fd.szFullFile, sizeof(chrLastImageDir));
     657                break;
     658              case MT_VIDEO:
     659                strlcpy(chrLastImageDir, fd.szFullFile, sizeof(chrLastImageDir));
     660                break;
     661              default:
     662                break;
     663              }
    277664            strcat(chrFullName, chrName);
    278 
     665            strlcpy(chrSourceName, chrFullName, sizeof(chrSourceName));
    279666            switch(iMediaType)
    280667              {
     
    289676                  ULONG ulPlaySecs;
    290677
     678                  MMAudioStop(hwndPlayer, hwnd);
     679
    291680                  memset(&mmio,0, sizeof(mmio));
    292681                  mmio.ulFlags=MMIO_READ;
     
    304693                  if(rc!=MMIO_SUCCESS) {
    305694                    WinSetWindowText(WinWindowFromID(hwnd, IDST_AUDIOINFO), "");
     695                    enableAudioPlayControls(hwnd, FALSE);
    306696                    break;
    307697                  }
    308698
    309699                  ulPlaySecs=mmAudioHeader.mmXWAVHeader.XWAVHeaderInfo.ulAudioLengthInMS/1000;
    310                   sprintf(text, audioText,
    311                           ulPlaySecs/60, ulPlaySecs%60,
     700                  sprintf(text, audioText,  ulPlaySecs/60, ulPlaySecs%60,
    312701                          mmAudioHeader.mmXWAVHeader.WAVEHeader.ulSamplesPerSec,
    313702                          mmAudioHeader.mmXWAVHeader.WAVEHeader.usBitsPerSample,
    314703                          mmAudioHeader.mmXWAVHeader.WAVEHeader.usChannels);
    315704                  WinSetWindowText(WinWindowFromID(hwnd, IDST_AUDIOINFO), text);
    316                  
     705                  enableAudioPlayControls(hwnd, TRUE);
    317706                  break;
    318707                }
     
    320709                if(hBitmap) {
    321710                  HBITMAP hBitmapTemp;
    322                   hBitmapTemp=loadBitmap (chrFullName, &bmpInfoHeader2);           
     711                  //                  hBitmapTemp=loadBitmap (chrFullName, &bmpInfoHeader2);
     712                  hBitmapTemp=ImgLoadImageFileAndHeader(chrFullName, &bmpInfoHeader2);
    323713                  GpiDeleteBitmap(hBitmap);
    324714                  hBitmap=hBitmapTemp;
    325715                }
    326716                else
    327                   hBitmap=loadBitmap (chrFullName, &bmpInfoHeader2);
     717                  hBitmap=ImgLoadImageFileAndHeader(chrFullName, &bmpInfoHeader2);
     718                  //                  hBitmap=loadBitmap (chrFullName, &bmpInfoHeader2);
    328719                /* Force redraw of preview area */
    329720                WinInvalidateRect(WinWindowFromID(hwnd, IDSR_IMGPREVIEW), NULLHANDLE, FALSE);
     
    342733      switch(SHORT1FROMMP(mp1))
    343734        {
     735        case IDPB_MMFINDPLAY:
     736          {
     737          MMAudioPlayFile(hwndPlayer, hwnd, NULLHANDLE);
     738          return MRFALSE;
     739          }
     740        case IDPB_MMFINDSTOP:
     741          {
     742          MMAudioStop(hwndPlayer, hwnd);
     743          return MRFALSE;
     744          }
     745        case IDPB_MMFINDPAUSE:
     746          {
     747          MMAudioPause(hwndPlayer, hwnd);
     748          return MRFALSE;
     749          }
    344750        case IDPB_NEWFILE: /* New */
    345751          {
    346752            HOBJECT hObject;
     753
     754            MMAudioStop(hwndPlayer, hwnd);
     755            MMAudioClosePlayer(hwndPlayer);
     756
     757            /* Open the MM templates folder */
    347758            if((hObject=WinQueryObject("<MMPM2_MMTEMPLATEFOLDER>"))!=NULLHANDLE) {
    348759              WinOpenObject(hObject, OPEN_DEFAULT, TRUE);
     
    350761            }
    351762            else
    352               showMessageBox2(hwnd, IDSTR_NOMMTEMPLATEFLDRTITLE, IDSTR_NOMMTEMPLATEFLDR, RESSOURCEHANDLE, MB_MOVEABLE|MB_OK);
    353 
     763              MsgShowMessageBox(hwnd, IDSTR_NOMMTEMPLATEFLDRTITLE, IDSTR_NOMMTEMPLATEFLDR,
     764                                RESSOURCEHANDLE, MB_MOVEABLE|MB_OK);
    354765            return MRFALSE;
    355766          }
    356767        default:
     768          //          MMAudioStop(hwndPlayer, hwnd);
     769          stopAudioFile(hwnd);
     770          MMAudioClosePlayer(hwndPlayer);
     771          // DosSleep(1000);
    357772          break;
    358773        }
     
    363778}
    364779
     780BOOL getStringFromRexxScript(PSZ pszBinDir, PSZ rexxFile, char* chrResult, ULONG ulSize)
     781{
     782
     783  RXSTRING arg[1];                    /* argument string for REXX  */
     784  RXSTRING rexxretval;                /* return value from REXX    */
     785  APIRET   rc;                        /* return code from REXX     */
     786  SHORT    rexxrc = 0;                /* return code from function */
     787  char theScript[CCHMAXPATH]; 
     788  /* By setting the strlength of the output RXSTRING to zero, we   */
     789  /* force the interpreter to allocate memory and return it to us. */
     790  /* We could provide a buffer for the interpreter to use instead. */
     791  rexxretval.strlength = 0L;          /* initialize return to empty*/
     792   
     793  sprintf(theScript, "%s\\%s", pszBinDir, rexxFile);
     794
     795  /* Here we call the interpreter.  We don't really need to use    */
     796  /* all the casts in this call; they just help illustrate         */
     797  /* the data types used.                                          */
     798  rc=RexxStart((LONG)       0,             /* number of arguments   */
     799               (PRXSTRING)  &arg,          /* array of arguments    */
     800               (PSZ)        theScript,     /* name of REXX file     */
     801               (PRXSTRING)  0,             /* No INSTORE used       */
     802               (PSZ)        "CWRXX",       /* Command env. name     */
     803               (LONG)       RXSUBROUTINE,  /* Code for how invoked  */
     804               (PRXSYSEXIT) 0,             /* No EXITs on this call */
     805               (PSHORT)     &rexxrc,       /* Rexx program output   */
     806               (PRXSTRING)  &rexxretval ); /* Rexx program output   */
     807#if 0
     808  if(rc) {
     809    sprintf(text,"Error in the Rexx skript %s\n\n Get more information with 'help REX%04d'.\n",
     810            tPt->rexxSkript, rc*-1);
     811    WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, text, "", 1234, MB_OK|MB_MOVEABLE|MB_ERROR);
     812  }
     813#endif
     814  if(!rc) {
     815    if(ulSize>rexxretval.strlength) {
     816      strncpy(chrResult, rexxretval.strptr, rexxretval.strlength);
     817      chrResult[rexxretval.strlength]=0;
     818    }
     819    else
     820      strncpy(chrResult, rexxretval.strptr, ulSize);
     821    chrResult[ulSize-1]=0;
     822  }
     823  if(rexxretval.strptr)
     824    DosFreeMem(rexxretval.strptr);          /* Release storage given to us by REXX.  */     
     825  if(!rc)
     826    return TRUE;
     827  else
     828    return FALSE;
     829}
     830/*
     831  This function checks the installed image IO procs and adds extensions which are not yet handled
     832  to the list of known extensions.
     833 */
     834static BOOL getMissingExtFromImageIOProc(char *chrMMImageKnownExt, ULONG ulSize)
     835{
     836    MMFORMATINFO  mmFormatInfo;
     837    PMMFORMATINFO pmmFormatInfoArray;
     838    void * memPtr;
     839    ULONG         ulReturnCode;
     840    LONG          lFormatsRead;
     841    LONG          index;
     842    LONG lNumIOProcs;
     843
     844    memset( &mmFormatInfo,
     845            '\0',
     846            sizeof(MMFORMATINFO) );
     847   
     848    mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE;
     849    mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/   
     850    ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo,
     851                                          &lNumIOProcs,
     852                                          0,
     853                                          0 );
     854   
     855    if( ulReturnCode != MMIO_SUCCESS )
     856      {
     857        /*
     858         * Error - mmioQueryFormatCount failed.
     859         */
     860        return FALSE;
     861      }
     862
     863    /*
     864     * Allocate enough memory for n number of FormatInfo blocks
     865     */
     866    pmmFormatInfoArray = malloc (lNumIOProcs * sizeof( MMFORMATINFO ) );
     867    memPtr=pmmFormatInfoArray;
     868    if( pmmFormatInfoArray == NULL )
     869      {
     870        /*
     871         * Could not allocate enough memory for mmFormatInfo array.
     872         */
     873        return FALSE;
     874      }
     875   
     876    /*
     877     * call mmioGetFormats to get info on the formats supported.
     878     */
     879    ulReturnCode = mmioGetFormats( &mmFormatInfo,
     880                                   lNumIOProcs,
     881                                   pmmFormatInfoArray,
     882                                   &lFormatsRead,
     883                                   0,
     884                                   0 );
     885    if( ulReturnCode != MMIO_SUCCESS )
     886      {
     887        /*
     888         *  mmioGetFormats failed.
     889         */
     890        free(pmmFormatInfoArray);
     891        return FALSE;
     892      }
     893   
     894    if( lFormatsRead != lNumIOProcs )
     895      {
     896        /*
     897         * Error in MMIO - number of formats read in by
     898         * mmioGetFormats is not equal to number of formats
     899         * found by mmioQueryFormatCount.
     900         */
     901        free(pmmFormatInfoArray);
     902        return FALSE;
     903      }
     904
     905    for ( index = 0; index <lNumIOProcs; index++ )
     906      {
     907        /* Now scan the whole image proc array */
     908        if(!strstr(chrMMImageKnownExt, pmmFormatInfoArray->szDefaultFormatExt)) {
     909          /* This extension is yet unknown */
     910          if(chrMMImageKnownExt[0]==0) {
     911            /* It's the first one */
     912            sprintf(chrMMImageKnownExt,"*.%s", pmmFormatInfoArray->szDefaultFormatExt);
     913          }
     914          else {
     915            /* Check if the extension is not already added (e.g. TIF has a lot of subformats) */
     916            if(!strstr(chrMMImageKnownExt, pmmFormatInfoArray->szDefaultFormatExt)) {
     917              strlcat(chrMMImageKnownExt,";*.", ulSize);
     918              strlcat(chrMMImageKnownExt, pmmFormatInfoArray->szDefaultFormatExt, ulSize);
     919            }
     920          }
     921        } 
     922        /*
     923         *  advance to next entry in mmFormatInfo array
     924         */       
     925        pmmFormatInfoArray++;
     926      }
     927    free(memPtr);
     928    return FALSE;
     929}
     930
     931
    365932int main (int argc, char *argv[])
    366933{
     
    370937  short a;
    371938
    372   //  FILEDLG fd = { 0 };
    373 
    374939  /* Create a copy of the args */
    375940  /* argv[0]: progname
    376    * argv[1]: audio file
    377941   */
    378942
     
    394958      }
    395959      else {
    396         HWND hwndDlg;
     960        HWND hwndDlg;       
    397961
    398962        /* Get our ressource dll */ 
    399963        RESSOURCEHANDLE=queryResModuleHandle(argv[0]);
     964        /* Load NLV strings */
     965        loadStringsFromResourceDLL(RESSOURCEHANDLE);
     966
    400967        /* Get data from INI file */
    401968        HlpBuildMMProgIniFileName(argv[0], chrIniFile, sizeof(chrIniFile));
    402969
    403         globalHab=WinQueryAnchorBlock(HWND_DESKTOP);
    404 
     970        /* Get additional audio extensions from mmpm2.ini */
     971        getStringFromRexxScript(queryExeDir(argv[0]), "audioext.rx",
     972                                chrAdditionalExt, sizeof(chrAdditionalExt));
     973        if(strlen(chrAdditionalExt)!=0) {
     974          translateChars(chrAdditionalExt, ',', ';');
     975          strlcat(chrMediaFileExt[MT_AUDIO], ";", sizeof(chrMediaFileExt[MT_AUDIO]));
     976          strlcat(chrMediaFileExt[MT_AUDIO], chrAdditionalExt, sizeof(chrMediaFileExt[MT_AUDIO]));
     977        }
     978
     979        /* Get image extensions */
     980        getStringFromRexxScript(queryExeDir(argv[0]), "imageext.rx",
     981                                chrMediaFileExt[MT_IMAGE], sizeof(chrMediaFileExt[MT_IMAGE]));
     982        if(strlen(chrMediaFileExt[MT_IMAGE])!=0)
     983          translateChars(chrMediaFileExt[MT_IMAGE], ',', ';');
     984        /* Get additional image extensions supplied by the user in imageadd.rx */
     985        chrAdditionalExt[0]=0;
     986        getStringFromRexxScript(queryExeDir(argv[0]), "imageadd.rx",
     987                                chrAdditionalExt, sizeof(chrAdditionalExt));
     988        if(strlen(chrAdditionalExt)!=0) {
     989          translateChars(chrAdditionalExt, ',', ';');
     990          strlcat(chrMediaFileExt[MT_IMAGE], ";", sizeof(chrMediaFileExt[MT_IMAGE]));
     991          strlcat(chrMediaFileExt[MT_IMAGE], chrAdditionalExt, sizeof(chrMediaFileExt[MT_IMAGE]));
     992        }
     993        /* Get extensions handled by installed IO procs */
     994        getMissingExtFromImageIOProc(chrMediaFileExt[MT_IMAGE], sizeof(chrMediaFileExt[MT_IMAGE]));
     995
     996#if 0
     997        sprintf(chrInstallDir, "%d!%s!", strlen(chrMediaFileExt[MT_IMAGE]), chrMediaFileExt[MT_IMAGE]);
     998        WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, chrInstallDir, chrMediaFileExt[MT_IMAGE], 1234, MB_OK);
     999#endif
     1000
     1001        /* Restore recent visited directories */
     1002        PrfQueryString(NULLHANDLE, chrIniFile, "mmfind", "lastaudiodir", "", chrLastAudioDir, sizeof(chrLastAudioDir));
     1003        PrfQueryString(NULLHANDLE, chrIniFile, "mmfind", "lastvideodir", "", chrLastVideoDir, sizeof(chrLastVideoDir));
     1004        PrfQueryString(NULLHANDLE, chrIniFile, "mmfind", "lastimagedir", "", chrLastImageDir, sizeof(chrLastImageDir));
     1005
     1006        _loadButtonBmps();
    4051007        fd.cbSize = sizeof( fd );
    4061008        /* It's an centered 'Open'-dialog */
    4071009        fd.fl = FDS_OPEN_DIALOG|FDS_CENTER | FDS_CUSTOM;
    408         /* Title: "Search CDRecord/2" */
    409         //getMessage(text,IDSTR_FDLGSEARCHCDRDAOTITLE,sizeof(text), hSettingsResource,hwnd);
    410         /* Set the title of the file dialog */
    411         //fd.pszTitle = text;
    412         //        fd.pszTitle = "Find file";
    413         /* Only show *.wav files */
    414         sprintf(fd.szFullFile,"%s","*.wav");
    4151010        fd.hMod=RESSOURCEHANDLE;
    4161011        fd.usDlgId=IDDLG_MMFIND;
    4171012        fd.pfnDlgProc=findFileDlgProc;
    418         //SysWriteToTrapLog("%x\n", fd.hMod);
     1013
     1014
     1015        switch(iMediaType)
     1016          {
     1017          case MT_AUDIO:
     1018            strlcpy(fd.szFullFile, chrLastAudioDir, sizeof(fd.szFullFile));
     1019            break;
     1020          case MT_IMAGE:
     1021            strlcpy(fd.szFullFile, chrLastImageDir, sizeof(fd.szFullFile));
     1022            break;
     1023          case MT_VIDEO:
     1024            strlcpy(fd.szFullFile, chrLastVideoDir, sizeof(fd.szFullFile));
     1025            break;
     1026          default:
     1027            break;
     1028          }
     1029
    4191030        if( (hwndDlg=WinFileDlg( HWND_DESKTOP, HWND_DESKTOP, &fd )) != NULLHANDLE )
    4201031          {
    421             /* Set dialog font to WarpSans for Warp 4 and above */
    4221032            if(hBitmap)
    423               GpiDeleteBitmap(hBitmap);
    424  
     1033              GpiDeleteBitmap(hBitmap); 
    4251034            if( fd.lReturn == DID_OK )
    4261035              {
     
    4371046                    {
    4381047                      HOBJECT hObject;
    439                       char *chr;
     1048
     1049                      /* Open the audio file in the editor */
    4401050                      if((hObject=WinQueryObject(fd.szFullFile))!=NULLHANDLE)
    441                         WinOpenObject(hObject, OPEN_DEFAULT, TRUE);
    442                       if((chr=strrchr(fd.szFullFile, '\\'))!=NULLHANDLE) {
    443                         *chr=0;
    444                         if((hObject=WinQueryObject(fd.szFullFile))!=NULLHANDLE)
    445                           WinOpenObject(hObject, OPEN_CONTENTS, TRUE);
    446                       }
     1051                        WinOpenObject(hObject, ID_MENU_EDITOR, TRUE);
     1052                      // WinOpenObject(hObject, OPEN_DEFAULT, TRUE);
    4471053                      break;
    4481054                    }
     
    4521058                      char *chr;
    4531059                      if((hObject=WinQueryObject(fd.szFullFile))!=NULLHANDLE)
    454                         WinOpenObject(hObject, OPEN_DEFAULT, TRUE);
     1060                        WinOpenObject(hObject, ID_MENU_PLAYER /* OPEN_DEFAULT */, TRUE);
     1061#if 0
     1062                      /* Open folder */
    4551063                      if((chr=strrchr(fd.szFullFile, '\\'))!=NULLHANDLE) {
    4561064                        *chr=0;
     
    4581066                          WinOpenObject(hObject, OPEN_CONTENTS, TRUE);
    4591067                      }
     1068#endif
    4601069                      break;
    4611070                    }
     
    4641073                      HOBJECT hObject;
    4651074                      char *chr;
    466                       //if((hObject=WinQueryObject(fd.szFullFile))!=NULLHANDLE)
    467                       // WinOpenObject(hObject, OPEN_DEFAULT, TRUE);
    4681075                      if((chr=strrchr(fd.szFullFile, '\\'))!=NULLHANDLE) {
    4691076                        *chr=0;
     
    4751082                  }/* switch()*/
    4761083              }/* DID_OK */
    477           }
    478         //        freeResHandle();
     1084            /* Save the last visited directories */
     1085            PrfWriteString(NULLHANDLE, chrIniFile, "mmfind", "lastaudiodir", chrLastAudioDir);
     1086            PrfWriteString(NULLHANDLE, chrIniFile, "mmfind", "lastvideodir", chrLastVideoDir);
     1087            PrfWriteString(NULLHANDLE, chrIniFile, "mmfind", "lastimagedir", chrLastImageDir);
     1088          }
     1089        freeResHandle();
    4791090      }
    4801091      WinDestroyMsgQueue(hmq);
  • trunk/classes/mm-progs/mmfind/mmfind.rc

    r2 r4  
    22   #include <os2.h>
    33#endif
     4#include "mmfind.h"
    45
    5 rcinclude mmfind.dlg
     6BITMAP IDBMP_PLAY  "./bmp/play.bmp"
     7BITMAP IDBMP_STOP  "./bmp/stop.bmp"
  • trunk/classes/mm-progs/volume/classvolume.DEF

    r2 r4  
    1 ; DEF-file for classvol.exe. This is a PM program which
    2 ; controls the volume of playing audio objects.
    31;
    4 ;                    (C) Chris Wohlgemuth 2003
    5 
     2; CLASSVOL: PM-Program for volume control
     3;
     4;
     5;    (c) Chris Wohlgemuth 2003-2005
     6;
     7;
     8; Created 14 Aug 2005 21:06:17
     9;
    610;/*
    711; * This program is free software; you can redistribute it and/or modify
     
    2630; */
    2731NAME CLASSVOL WINDOWAPI
    28 DESCRIPTION '$@#(c) Chris Wohlgemuth :V0.2.7 (17.08.2003) ()#@PM-Program for volume control'
     32DESCRIPTION '$@#(c) C. Wohlgemuth 2005:0.2        #@##1## 14/08/05 21:06:17        My ;-)     ::::9::@@PM-Program for volume control V0.2.9'
    2933STACKSIZE    1638400
    30 
    31 
    32 
    33 
  • trunk/classes/mm-progs/volume/makefile

    r2 r4  
    33include ../../../make.inc
    44
    5 CC           = gcc
    6 LIB_DIR      = $d:/emx/lib
    7 #CPPFLAGS     = -Ge- /Gm+ -G4 -Gl  /O+ -Oc+ -Ol
    8 #CPPFLAGS     = -O -Zomf -Zcrtdll -Zmtd -s
    9 CPPFLAGS     = -O -Wall -Zomf -Zmt -Zsys -s
    10 INC             = ../include -I ../../../classes/inc -I ../../../common_functions/include
    11 DEFS         =
    12 PROGS        = 
    13 ODIR            = .
    14 CPPDIR  = .
    15 LIBDIR  =       ../lib
    16 OBJECTS =       $(LIBDIR)/message.obj $(LIBDIR)/helper.obj $(LIBDIR)/menu_funcs.obj $(LIBDIR)/sys_funcs.obj
    17 OBJS2           =        customprocs.obj
    18 # display.obj
     5# MM-progs specific makefile include
     6include ../mmprog.inc
    197
     8OBJECTS         =       $(LIBDIR)/message.obj \
     9                        $(LIBDIR)/helper.obj \
     10                        $(LIBDIR)/menu_funcs.obj \
     11                        $(LIBDIR)/sys_funcs.obj
     12OBJS2           =       customprocs.obj
    2013
    2114all:    classvol.exe
    2215
    23 $(LIBDIR)/%.obj:        $(COMMONSRC)/%.c
    24         gcc -c -Wall -o$@ -Zomf -I$(INC) $< 
    25 
    26 %.obj:  %.c
    27         gcc -c -Wall -o$@ -Zomf -I$(INC) $< 
    28 
    29 classvol.exe:   classvol.c $(OBJECTS) $(OBJS2) makefile
     16classvol.exe:   classvol.c $(OBJECTS) $(OBJS2) makefile def.tpl
     17        cmd /C $(TOOLDIR)\create_MMPROG_def.cmd classvolume.def
    3018#Use this command to link dynamicaly
    31         gcc $(CPPFLAGS) -I$(INC) classvol.c $(OBJECTS) $(OBJS2) -los2me classvolume.def
     19        $(CC) $(CPPFLAGS) -I$(INC) classvol.c $(OBJECTS) $(OBJS2) -los2me classvolume.def
    3220        rc classvolume.rc classvol.exe
    3321
    3422
     23       
    3524clean:
    3625        -rm *.exe
     26        -rm *.dll
    3727        -rm *.obj
     28        -rm *.res
    3829        -rm *.ini
    39         -rm *.res
    4030
    4131cleaner:
     
    4333        -rm *.flc
    4434
     35
    4536distribution:
    46        
    47 
  • trunk/classes/res/de/cwaudio_de.rc

    r2 r4  
    6969STRINGTABLE
    7070BEGIN
    71 ID_WAVEINFOPAGENAME "~Audio Information"
    72 ID_ID3TAGSPAGENAME  "~ID3 Tags"
     71ID_WAVEINFOPAGENAME "~Audio-Information"
     72ID_ID3TAGSPAGENAME  "~ID3-Tags"
    7373ID_TRACKNAMEPAGENAME "~Trackname"
    7474IDSTR_TRACKNAME      "Trackname"
  • trunk/classes/res/de/cwimage_de.rc

    r2 r4  
    2626IDSTR_CWIMAGETITLE  "Digitales Bild"
    2727
    28 IDSTR_IMAGEINFOPAGENAME "~Bild Information"
     28IDSTR_IMAGEINFOPAGENAME "~Bild-Information"
    2929IDSTR_SPRINTFPIXEL      "%d Pixel"
    3030IDSTR_SPRINTFBIT       "%d Bit"
  • trunk/classes/res/de/makefile

    r2 r4  
    44include ../../../build.inc
    55
    6 LANGUAGE        =       _DE
     6LANGUAGE        =       _de
    77
    88CC           = icc
     
    2727                icc $(CPPFLAGS) -I$(INC) /Fe$(OBJDIR)\$@ $< mmres$(LANGUAGE).def
    2828                rc -D $(ECS) -i $(INC) mmres$(LANGUAGE).rc $(OBJDIR)/mmres$(LANGUAGE).dll
     29                rc -r -D $(ECS) -i $(INC) mmres$(LANGUAGE).rc $(OBJDIR)/mmres$(LANGUAGE).res
    2930#               rc  mmres$(LANGUAGE).res $(OBJDIR)/mmres$(LANGUAGE).dll
    3031
  • trunk/classes/res/de/mmfind_de.dlg

    r2 r4  
    3737        CTEXT           "Keine Vorschau verfgbar", IDST_NOPREVIEWAVAILABLE, 251, 42, 78, 33,
    3838                        DT_WORDBREAK | NOT WS_VISIBLE
    39         LTEXT           "", IDST_AUDIOINFO, 253, 21, 75, 62, DT_WORDBREAK | NOT
     39        LTEXT           "", IDST_AUDIOINFO, 253, 41, 75, 42, DT_WORDBREAK | NOT
    4040                        WS_VISIBLE
    4141        GROUPBOX        "Audio-Information", IDGB_AUDIOINFO, 245, 17, 89, 79, NOT WS_VISIBLE
     42        PUSHBUTTON      "Stop", IDPB_MMFINDSTOP, 267, 19, 21, 10,
     43                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
     44        PUSHBUTTON      "Play", IDPB_MMFINDPLAY, 291, 19, 21, 10,
     45                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    4246        DEFPUSHBUTTON   "~OK", DID_OK, 3, 2, 40, 12
    4347        PUSHBUTTON      "~Neu...", IDPB_NEWFILE, 46, 2, 40, 12
  • trunk/classes/res/de/mmfind_de.rc

    r2 r4  
    88IDSTR_TYPEIMAGE       "Bilddatei"
    99IDSTR_TYPEVIDEO       "Videodatei"
    10 IDSTR_AUDIOINFOTEXT   "Spielzeit:\t%02d:%02d\n\nSamplerate:\t%d\n\nBits pro Sample:\t%d\n\nKan„le:\t%d"
     10IDSTR_AUDIOINFOTEXT   "Spielzeit:\t%02d:%02d\x0a\x0aSamplerate:\t%d\x0a\x0aBits pro Sample:\t%d\x0a\x0aKan„le:\t\t%d"
    1111IDSTR_NOMMTEMPLATEFLDRTITLE "Fehler bei Dateierstellung"
    1212IDSTR_NOMMTEMPLATEFLDR "Multimedia-Schablonenordner kann nicht gefunden werden. M”glicherweise ist die Objekt-ID <MMPM2_MMTEMPLATEFOLDER> verloren gegangen."
  • trunk/classes/res/en/mmfind_en.dlg

    r2 r4  
    3737        CTEXT           "No preview available", IDST_NOPREVIEWAVAILABLE, 251, 42, 78, 33,
    3838                        DT_WORDBREAK | NOT WS_VISIBLE
    39         LTEXT           "", IDST_AUDIOINFO, 253, 21, 75, 62, DT_WORDBREAK | NOT
     39        LTEXT           "", IDST_AUDIOINFO, 253, 41, 75, 42, DT_WORDBREAK | NOT
    4040                        WS_VISIBLE
    4141        GROUPBOX        "Audio info", IDGB_AUDIOINFO, 245, 17, 89, 79, NOT WS_VISIBLE
     42        PUSHBUTTON      "Stop", IDPB_MMFINDSTOP, 267, 19, 21, 10,
     43                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
     44        PUSHBUTTON      "Play", IDPB_MMFINDPLAY, 291, 19, 21, 10,
     45                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    4246        DEFPUSHBUTTON   "~OK", DID_OK, 3, 2, 40, 12
    4347        PUSHBUTTON      "~New...", IDPB_NEWFILE, 46, 2, 40, 12
  • trunk/classes/res/en/mmfind_en.rc

    r2 r4  
    88IDSTR_TYPEIMAGE       "Image"
    99IDSTR_TYPEVIDEO       "Video"
    10 IDSTR_AUDIOINFOTEXT   "Play time:\t%02d:%02d\n\nSamplerate:\t%d\n\nBits per sample:\t%d\n\nChannels:\t%d"
     10IDSTR_AUDIOINFOTEXT   "Play time:\t%02d:%02d\x0a\x0aSamplerate:\t%d\x0a\x0aBits per sample:\t%d\x0a\x0aChannels:\t%d"
    1111IDSTR_NOMMTEMPLATEFLDRTITLE "Error during file creation"
    1212IDSTR_NOMMTEMPLATEFLDR "Multimedia template folder can't be found. It may has lost the object ID <MMPM2_MMTEMPLATEFOLDER>."
  • trunk/classes/res/it/mmfind_it.dlg

    r2 r4  
    3838        CTEXT           "Anteprima non disponibile", IDST_NOPREVIEWAVAILABLE, 251, 42, 78, 33,
    3939                        DT_WORDBREAK | NOT WS_VISIBLE
    40         LTEXT           "", IDST_AUDIOINFO, 253, 21, 75, 62, DT_WORDBREAK | NOT
     40        LTEXT           "", IDST_AUDIOINFO, 253, 41, 75, 42, DT_WORDBREAK | NOT
    4141                        WS_VISIBLE
    4242        GROUPBOX        "Informazioni audio", IDGB_AUDIOINFO, 245, 17, 89, 79, NOT WS_VISIBLE
     43        PUSHBUTTON      "Stop", IDPB_MMFINDSTOP, 267, 19, 21, 10,
     44                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
     45        PUSHBUTTON      "Play", IDPB_MMFINDPLAY, 291, 19, 21, 10,
     46                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    4347        DEFPUSHBUTTON   "~OK", DID_OK, 3, 2, 40, 12
    4448        PUSHBUTTON      "~Nuovo", IDPB_NEWFILE, 46, 2, 40, 12
  • trunk/classes/res/it/mmfind_it.rc

    r2 r4  
    88IDSTR_TYPEIMAGE       "Immagine"
    99IDSTR_TYPEVIDEO       "Video"
    10 IDSTR_AUDIOINFOTEXT   "Tempo trascorso:\t%02d:%02d\n\nFrequenza campionamento:\t%d\n\nBit per campione:\t%d\n\nCanali:\t%d"
     10IDSTR_AUDIOINFOTEXT   "Tempo trascorso:\t%02d:%02d\x0a\x0aFrequenza campionamento:\t%d\x0a\x0aBit per campione:\t%d\x0a\x0aCanali:\t%d"
    1111IDSTR_NOMMTEMPLATEFLDRTITLE "Errore durante la creazione del file"
    1212IDSTR_NOMMTEMPLATEFLDR "Impossibile trovare il modello per la cartella multimedia. Potrebbe essersi persa la ID oggetto <MMPM2_MMTEMPLATEFOLDER>."
  • trunk/classes/res/makefile

    r2 r4  
    33include ../../make.inc
    44
    5 INC             = ../include
    65CURDIR          = .
    76
    87.PHONY:         clean cleaner clean_nlv
    98
    10 all:    nlv
    11         cd ./common_res && make
     9all:    nlv common_res
    1210
    1311nlv:
    14         @echo "[35;1;mCreating laguage files.[0;m"
     12        @echo "[35;1;mCreating laguage resources.[0;m"
    1513        @for i in $(LANGUAGES); \
    1614        do \
     
    1816                cd $(CURDIR)/$$i && make LANGUAGE=_$$i && cd .. ; \
    1917        done
     18
     19common_res:
     20        cd ./common_res && make
    2021
    2122clean_nlv:
  • trunk/classes/res/nl/mmfind_nl.dlg

    r2 r4  
    3737        CTEXT           "No preview available", IDST_NOPREVIEWAVAILABLE, 251, 42, 78, 33,
    3838                        DT_WORDBREAK | NOT WS_VISIBLE
    39         LTEXT           "", IDST_AUDIOINFO, 253, 21, 75, 62, DT_WORDBREAK | NOT
     39        LTEXT           "", IDST_AUDIOINFO, 253, 41, 75, 42, DT_WORDBREAK | NOT
    4040                        WS_VISIBLE
    4141        GROUPBOX        "Audio info", IDGB_AUDIOINFO, 245, 17, 89, 79, NOT WS_VISIBLE
     42        PUSHBUTTON      "Stop", IDPB_MMFINDSTOP, 267, 19, 21, 10,
     43                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
     44        PUSHBUTTON      "Play", IDPB_MMFINDPLAY, 291, 19, 21, 10,
     45                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    4246        DEFPUSHBUTTON   "~OK", DID_OK, 3, 2, 40, 12
    4347        PUSHBUTTON      "~New...", IDPB_NEWFILE, 46, 2, 40, 12
  • trunk/classes/res/nl/mmfind_nl.rc

    r2 r4  
    88IDSTR_TYPEIMAGE       "Image"
    99IDSTR_TYPEVIDEO       "Video"
    10 IDSTR_AUDIOINFOTEXT   "Play time:\t%02d:%02d\n\nSamplerate:\t%d\n\nBits per sample:\t%d\n\nChannels:\t%d"
     10IDSTR_AUDIOINFOTEXT   "Play time:\t%02d:%02d\x0a\x0aSamplerate:\t%d\x0a\x0aBits per sample:\t%d\x0a\x0aChannels:\t%d"
    1111IDSTR_NOMMTEMPLATEFLDRTITLE "Error during file creation"
    1212IDSTR_NOMMTEMPLATEFLDR "Multimedia template folder can't be found. It may has lost the object ID <MMPM2_MMTEMPLATEFOLDER>."
  • trunk/common_functions/helper.c

    r2 r4  
    7070void HlpWriteToTrapLog(const char* chrFormat, ...);
    7171
    72 #if 0
    73 /****************************************************
    74  *                                                  *
    75  * This funktion returns the running OS version:    *
    76  *                                                  *
    77  * 30: Warp 3, 40 Warp 4                            *
    78  *                                                  *
    79  ****************************************************/
    80 ULONG cwQueryOSRelease()
    81 {
    82   static ULONG ulVersionMinor=0;
    83 
    84   if(!ulVersionMinor)
    85     if(DosQuerySysInfo(QSV_VERSION_MINOR, QSV_VERSION_MINOR, &ulVersionMinor, sizeof(ulVersionMinor)))
    86       ulVersionMinor=30;/* Default Warp 3 */
    87 
    88   return ulVersionMinor;
    89 
    90 }
    91 #endif
    9272
    9373void removeLog(void)
     
    564544}
    565545#endif
    566 
     546#if 0
     547if(SysQueryHomeDir(chrHomeDir, sizeof(chrHomeDir))) {
     548    strcpy(chrPath, chrHomeDir);
     549    strncat(chrPath, "\\WPSWIZZ.INI", size-strlen(chrPath)-1);/* Default is INI file in users home dir */
     550    return;
     551  }
     552
     553  strcpy(chrPath, queryHelpPath());
     554  if((ptrChar=strrchr(chrPath, '\\'))!=NULLHANDLE) {
     555    *ptrChar=0;
     556    if((ptrChar=strrchr(chrPath, '\\'))!=NULLHANDLE)
     557      *ptrChar=0;
     558  }
     559  strncat(chrPath, "\\WPSWIZZ.INI", size-strlen(chrPath)-1);
     560  chrPath[size-1]=0;
     561#endif
     562
     563/*
     564  Query the path to the INI file used by the MM progs to store the private data.
     565  If a home dir exists on the users system the INI file will be create there otherwise
     566  in the directory where the calling EXE is located.
     567 */
    567568BOOL HlpBuildMMProgIniFileName(char* chrProgname, char * chrBuffer, ULONG ulBufferSize)
    568569{
    569570  char * chrPtr; 
    570   strncpy(chrBuffer, chrProgname,ulBufferSize);
    571   chrBuffer[ulBufferSize-1]=0;
     571
     572  /* Default is INI file in users home dir */
     573  if(SysQueryHomeDir(chrBuffer, ulBufferSize)) {
     574    strlcat(chrBuffer, MMCLS_INI_FILE_NAME, ulBufferSize); /* MMCLS_INI_FILE_NAME = "\\CWMM.INI" */
     575    return TRUE;
     576  }
     577
     578  /* No HOME dir for some reason */
     579  strlcpy(chrBuffer, chrProgname, ulBufferSize);
    572580
    573581  if((chrPtr=strrchr(chrBuffer,'\\'))==NULLHANDLE)
    574     return FALSE;
     582    return FALSE; // This shouldn't happen!
    575583
    576584  *chrPtr=0;
    577   strncat(chrBuffer,INI_FILE_NAME, ulBufferSize-strlen(chrBuffer)-1);
     585  strlcat(chrBuffer, MMCLS_INI_FILE_NAME, ulBufferSize);
    578586
    579587  return TRUE;
  • trunk/common_functions/img_funcs.c

    r2 r4  
    22  This file conatins functions for loading image files.
    33 */
     4
    45#define  INCL_PM
     6#define INCL_OS2MM
    57#define  INCL_MMIOOS2
    68
     
    1820/* This function loads a supported image file.      */
    1921/* Every format for which MMOS2 has an IO procedure */
    20 /* may be used here.                                */
     22/* may be used here. In contrast to                 */
     23/* ImgLoadImageFile() a provided BMPINFOHEADER2     */
     24/* structure is filled with data.                   */
     25/*                                                  */
    2126/*                                                  */
    2227/* @@RETURNS                                        */
     
    2429/* HBITMAP hBitmap                                  */
    2530/*                                                  */
    26 /* HAndle to the bitmap of NULL.                    */
     31/* Handle to the bitmap or NULL.                    */
     32/*                                                  */
     33/* @@PARAM                                          */
     34/*                                                  */
     35/* PSZ pszFileName input                            */
     36/*                                                  */
     37/* Name of the image file to load.                  */
     38/*                                                  */
     39/* @@PARAM                                          */
     40/*                                                  */
     41/* PBITMAPINFOHEADER2 pBMPInfoHeader2 in/out        */
     42/*                                                  */
     43/* Pointer to a BITMAPINFOHEADER2 structure.        */
     44/*                                                  */
     45/*                                                  */
     46/* @@REMARKS                                        */
     47/*                                                  */
     48/* The caller must free the bitmap handle after     */
     49/* use.                                             */
    2750/*                                                  */
    2851/*!!*************************************************/
    29 HBITMAP ImgLoadImageFile (  PSZ pszFileName )
     52HBITMAP ImgLoadImageFileAndHeader( PSZ pszFileName, PBITMAPINFOHEADER2 pBMPInfoHeader2)
    3053{
    3154    HBITMAP       hbm;
    32     HBITMAP       hbmTarget;
    3355    MMIOINFO      mmioinfo;
    34         MMFORMATINFO  mmFormatInfo;
     56    MMFORMATINFO  mmFormatInfo;
    3557    HMMIO         hmmio;
    36         ULONG         ulImageHeaderLength;
    37         MMIMAGEHEADER mmImgHdr;
     58    ULONG         ulImageHeaderLength;
     59    MMIMAGEHEADER mmImgHdr;
    3860    ULONG         ulBytesRead;
    3961    ULONG         dwNumRowBytes;
     
    131153            return (0L);
    132154    }
    133     /*
    134     memcpy(pBMPInfoHeader2, &mmImgHdr.mmXDIBHeader.BMPInfoHeader2,
    135            sizeof(BITMAPINFOHEADER2)+256*sizeof(RGB2) );
    136            */
     155
    137156    /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
     157    *pBMPInfoHeader2=mmImgHdr.mmXDIBHeader.BMPInfoHeader2;
    138158
    139159    /*
     
    226246                            NULL);
    227247
    228 #if 0
    229     hbm = GpiCreateBitmap ( hps,
    230                             pBMPInfoHeader2,
    231                             0L,
    232                             NULL,
    233                             NULL);
    234 #endif
    235 
    236248    if ( !hbm )
    237249    {
     
    250262      return(0L);
    251263    }
    252     /*
    253     // ***************************************************
    254     // Select the bitmap into the memory device context.
    255     // ***************************************************/
     264    /****************************************************
     265      Select the bitmap into the memory device context.
     266      ***************************************************/
    256267    hbReturnCode = GpiSetBitmap ( hps,
    257268                                  hbm );
    258     /*
    259     //***************************************************************
    260     //  LOAD THE BITMAP DATA FROM THE FILE
    261     //      One line at a time, starting from the BOTTOM
    262     //*************************************************************** */
     269    /***************************************************************
     270      LOAD THE BITMAP DATA FROM THE FILE
     271      One line at a time, starting from the BOTTOM
     272      ****************************************************************/
    263273
    264274    for ( dwRowCount = 0; dwRowCount < dwHeight; dwRowCount++ )
     
    294304
    295305
    296 BOOL ImgGetBmpInfoHeader(PBITMAPINFOHEADER2  bmpih2, PSZ pszFileName /*, char* procName, ULONG ulLength*/)
     306/*!**************************************************/
     307/*                                                  */
     308/* @@DESC                                           */
     309/*                                                  */
     310/* This function loads a supported image file.      */
     311/* Every format for which MMOS2 has an IO procedure */
     312/* may be used here.                                */
     313/*                                                  */
     314/* @@PARAM                                          */
     315/*                                                  */
     316/* PSZ pszFileName input                            */
     317/*                                                  */
     318/* Name of the image file to load.                  */
     319/*                                                  */
     320/* @@RETURNS                                        */
     321/*                                                  */
     322/* HBITMAP hBitmap                                  */
     323/*                                                  */
     324/* Handle to the bitmap of NULL.                    */
     325/*                                                  */
     326/*!!*************************************************/
     327HBITMAP ImgLoadImageFile (  PSZ pszFileName )
     328{
     329  BITMAPINFOHEADER2  bmpih2;
     330
     331  return ImgLoadImageFileAndHeader ( pszFileName, &bmpih2 );
     332}
     333
     334
     335
     336/*!**************************************************/
     337/*                                                  */
     338/* @@DESC                                           */
     339/*                                                  */
     340/* Build a BITMAPINFOHEADER2 for the given file.    */
     341/*                                                  */
     342/* @@PARAM                                          */
     343/*                                                  */
     344/* PSZ pszFileName input                            */
     345/*                                                  */
     346/* Name of the image file.                          */
     347/*                                                  */
     348/* @@PARAM                                          */
     349/*                                                  */
     350/* PBITMAPINFOHEADER2 pBMPInfoHeader2 in/out        */
     351/*                                                  */
     352/* Pointer to a BITMAPINFOHEADER2 structure.        */
     353/*                                                  */
     354/* @@RETURNS                                        */
     355/*                                                  */
     356/* TRUE on success, FALSE otherwise                 */
     357/*                                                  */
     358/*!!*************************************************/
     359BOOL ImgGetBmpInfoHeader(PSZ pszFileName, PBITMAPINFOHEADER2  bmpih2)
    297360{
    298361    MMIOINFO      mmioinfo;
     
    305368    ULONG         ulReturnCode;
    306369    ULONG ulBytesRead;
    307     char *pName;
    308370   
    309     //  if(procName)
    310     //   procName[0]=0;
    311 
    312371    /* Check file size */
    313372    if(SysQueryFileSize(pszFileName)==0)
  • trunk/common_functions/include/img_funcs.h

    r2 r4  
    33
    44HBITMAP ImgLoadImageFile (  PSZ pszFileName );
    5 BOOL ImgGetBmpInfoHeader(PBITMAPINFOHEADER2  bmpih2, PSZ pszFileName /*, char* procName, ULONG ulLength*/);
     5HBITMAP ImgLoadImageFileAndHeader (  PSZ pszFileName, PBITMAPINFOHEADER2 pBMPInfoHeader2);
     6BOOL ImgGetBmpInfoHeader(PSZ pszFileName, PBITMAPINFOHEADER2  bmpih2 /*, char* procName, ULONG ulLength*/);
    67
    78#endif
  • trunk/common_functions/include/ini_funcs.h

    r2 r4  
    66#endif
    77
    8 BOOL IniSaveWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd);
    9 BOOL IniRestoreWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd, ULONG fSize);
     8BOOL PrfSaveWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd);
     9BOOL PrfRestoreWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd, ULONG fSize);
     10BOOL PrfWriteString(HINI hini, char * iniFile, char* chrApp, char *chrKey, char* chrString);
     11BOOL PrfQueryString(HINI hini, char * iniFile, char* chrApp, char *chrKey, char* chrDefault, char* chrBuffer, ULONG ulSize);
    1012
    1113#if __cplusplus
  • trunk/common_functions/include/message_funcs.h

    r2 r4  
    99                  char* title, ULONG ulTitleID, LONG lSizeTitle,
    1010                  HMODULE hResource, HWND hwnd, ULONG ulFlags);
    11 ULONG showMessageBox2(HWND hwnd, ULONG ulIDTitle, ULONG ulIDText, HMODULE hModule, ULONG ulFlag);
     11ULONG MsgShowMessageBox(HWND hwnd, ULONG ulIDTitle, ULONG ulIDText, HMODULE hModule, ULONG ulFlag);
    1212BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
    1313BOOL MsgGetMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd);
     14
     15#if 0
     16ULONG showMessageBox2(HWND hwnd, ULONG ulIDTitle, ULONG ulIDText, HMODULE hModule, ULONG ulFlag);
     17#endif
     18
    1419#ifdef __CPLUSPLUS__
    1520}
  • trunk/common_functions/include/sys_funcs.h

    r2 r4  
    2828ULONG SysQueryDriveType(ULONG ulDriveNum);
    2929ULONG SysQueryFreeDriveSpace(ULONG ulDriveNum, ULONG *ulTotal, ULONG * ulFree, ULONG* ulBytesUnit);
    30 ULONG SysQueryDiskName(ULONG ulDriveNum, ULONG ulSize, char *chrBuffer);
     30ULONG SysQueryDiskName(ULONG ulDriveNum, char *chrBuffer, ULONG ulSize);
    3131BOOL SysQueryHomeDir(char* chrBuf, ULONG ulSize);
    3232
  • trunk/common_functions/ini_funcs.c

    r2 r4  
    11/*
    2  * This file is (C) Chris Wohlgemuth 2001-2004
     2 * This file is (C) Chris Wohlgemuth 2001-2005
    33 */
    4 
    54#define INCL_WIN
    65
    76#include <os2.h>
    87
    9 /*
    10   hini may be NULL. Then the filename is used to open the ini file.
    11  */
    12 /*!**************************************************/
     8/*!**************************************************/
     9/*                                                  */
     10/* @@MODULE                                         */
     11/*                                                  */
     12/* Profile functions                                */
    1313/*                                                  */
    1414/* @@DESC                                           */
     
    3131/*                                                  */
    3232/*!!*************************************************/
    33 BOOL IniSaveWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd)
     33BOOL PrfSaveWindowPos(HINI hini, char* iniFile, char* chrApp, char* chrKey, HWND hwnd)
    3434{
    3535  BOOL bError=FALSE;
     
    6565/*!**************************************************/
    6666/*                                                  */
     67/* @@MODULE                                         */
     68/*                                                  */
     69/* Profile functions                                */
     70/*                                                  */
    6771/* @@DESC                                           */
    6872/*                                                  */
     
    8589/*                                                  */
    8690/*!!*************************************************/
    87 BOOL IniRestoreWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd, ULONG fSize)
     91BOOL PrfRestoreWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd, ULONG fSize)
    8892{
    8993  HINI hiniPriv=hini;
     
    115119}
    116120
    117 
    118 
     121/*!**************************************************/
     122/*                                                  */
     123/* @@MODULE                                         */
     124/*                                                  */
     125/* Profile functions                                */
     126/*                                                  */
     127/* @@DESC                                           */
     128/*                                                  */
     129/* Save a string in an INI file.                    */
     130/*                                                  */
     131/*            .                                     */
     132/*                                                  */
     133/* @@REMARKS                                        */
     134/*                                                  */
     135/* If hini is NULL the given file name will be used */
     136/* for opening the INI file. If hini is not NULL    */
     137/* the file name is ignored.                        */
     138/*                                                  */
     139/* @@RETURNS                                        */
     140/*                                                  */
     141/* BOOL fSuccess                                    */
     142/*                                                  */
     143/* TRUE: Function succeeded.                        */
     144/* FALSE: Error occurred                            */
     145/*                                                  */
     146/*!!*************************************************/
     147BOOL PrfWriteString(HINI hini, char * iniFile, char* chrApp, char *chrKey, char* chrString)
     148{
     149  BOOL bError=FALSE;
     150  HINI hiniPriv=hini;
     151
     152  if(!hini && !iniFile)
     153    return FALSE;
     154
     155  do {
     156    if(!hiniPriv) {
     157      /* Open ini-file */
     158      if((hiniPriv=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),(unsigned char *)iniFile))
     159         ==NULLHANDLE)
     160        break;
     161    }/* end of if(!hiniPriv) */
     162
     163    if(!PrfWriteProfileString(hiniPriv, chrApp, chrKey, chrString))
     164      bError=TRUE;
     165
     166    if(hiniPriv && !hini)
     167      PrfCloseProfile(hiniPriv);
     168   
     169    if(bError)
     170      break;
     171    return TRUE;
     172  } while(TRUE);
     173  return FALSE;
     174}
     175
     176/*!**************************************************/
     177/*                                                  */
     178/* @@MODULE                                         */
     179/*                                                  */
     180/* Profile functions                                */
     181/*                                                  */
     182/* @@DESC                                           */
     183/*                                                  */
     184/* Get a string from an INI file.                   */
     185/*                                                  */
     186/*            .                                     */
     187/*                                                  */
     188/* @@REMARKS                                        */
     189/*                                                  */
     190/* If hini is NULL the given file name will be used */
     191/* for opening the INI file. If hini is not NULL    */
     192/* the file name is ignored.                        */
     193/*                                                  */
     194/* @@RETURNS                                        */
     195/*                                                  */
     196/* ULONG ulLength                                   */
     197/*                                                  */
     198/* TRUE: Function succeeded.                        */
     199/* FALSE: Error occurred                            */
     200/*                                                  */
     201/*!!*************************************************/
     202BOOL PrfQueryString(HINI hini, char * iniFile, char* chrApp, char *chrKey, char* chrDefault, char* chrBuffer, ULONG ulSize)
     203{
     204  HINI hiniPriv=hini;
     205  ULONG ulRC=0;
     206
     207  do{
     208    if(!hiniPriv) {
     209      if((hiniPriv=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),(unsigned char *)iniFile))
     210         ==NULLHANDLE)
     211        break;
     212    }/* end of if(!hini) */
     213
     214    ulRC=PrfQueryProfileString(hiniPriv, chrApp, chrKey, chrDefault, chrBuffer, ulSize);
     215
     216    if(hiniPriv && !hini)
     217      PrfCloseProfile(hiniPriv);
     218   
     219      break;
     220  } while(TRUE);
     221  return ulRC;
     222}
     223
     224
  • trunk/common_functions/listbox_funcs.c

    r2 r4  
    1414#endif
    1515
     16/*!***********************************************************/
     17/*                                                           */
     18/* @@DESC                                                    */
     19/*                                                           */
     20/* To be written...                                          */
     21/*                                                           */
     22/*!!**********************************************************/
    1623SHORT LBFindMatch(HWND hwndLB, char *chrMatchText)
    1724{
  • trunk/common_functions/menu_funcs.c

    r2 r4  
    7676}
    7777
     78/*!***********************************************************/
     79/*                                                           */
     80/* @@DESC                                                    */
     81/*                                                           */
     82/* To be written...                                          */
     83/*                                                           */
     84/*!!**********************************************************/
    7885SHORT menuQueryItemCount(HWND hwndMenu)
    7986{
     
    8289}
    8390
     91/*!***********************************************************/
     92/*                                                           */
     93/* @@DESC                                                    */
     94/*                                                           */
     95/* To be written...                                          */
     96/*                                                           */
     97/*!!**********************************************************/
    8498MRESULT menuCheckItem(HWND hwndMenu, USHORT usID, BOOL fIncludeSubMenu, BOOL fCheck)
    8599{
     
    88102}
    89103
     104/*!***********************************************************/
     105/*                                                           */
     106/* @@DESC                                                    */
     107/*                                                           */
     108/* To be written...                                          */
     109/*                                                           */
     110/*!!**********************************************************/
    90111MRESULT menuRemoveItem(HWND hwndMenu, USHORT usID, BOOL fIncludeSubMenu)
    91112{
     
    94115}
    95116
     117/*!***********************************************************/
     118/*                                                           */
     119/* @@DESC                                                    */
     120/*                                                           */
     121/* To be written...                                          */
     122/*                                                           */
     123/*!!**********************************************************/
    96124MRESULT menuCheckForItem(HWND hwndMenu, USHORT usID, BOOL fIncludeSubMenu)
    97125{
  • trunk/common_functions/message.c

    r2 r4  
    44#include <os2.h>
    55#include <stdio.h>
     6#include <stdlib.h>
    67#include <string.h>
    78
     
    4445/* ULONG ulResult                                   */
    4546/*                                                  */
    46 /* MBID_ERROR is case of an error.                  */
     47/* MBID_ERROR in case of an error.                  */
    4748/* :p.                                              */
    4849/* Result code from WinMessageBox().                */
     
    8283}
    8384
     85#if 0
    8486/*!**************************************************/
    8587/*                                                  */
     
    8991/* the resource DLL or the EXE file.                */
    9092/* Unlike messagebox no buffers must be given but   */
    91 /* only the string IDs. MAx title length is 100,    */
     93/* only the string IDs. Max title length is 256,    */
    9294/* max text length 256.                             */
     95/* :p.                                              */
     96/*                                                  */
     97/* This function is obsolete.                       */
     98/* Use MsgShowMessageBox() instead.                 */
    9399/*                                                  */
    94100/* @@RETURNS                                        */
     
    96102/* ULONG ulResult                                   */
    97103/*                                                  */
    98 /* MBID_ERROR is case of an error.                  */
     104/* MBID_ERROR in case of an error.                  */
    99105/* :p.                                              */
    100106/* Result code from WinMessageBox().                */
    101107/*                                                  */
     108/* @@REMARKS                                        */
     109/*                                                  */
     110/* This function is obsolete.                       */
     111/* Use MsgShowMessageBox() instead.                 */
    102112/*                                                  */
    103113/*!!*************************************************/
     
    105115{
    106116  char text[256];
    107   char title[100];
     117  char title[256];
    108118
    109119  return mBox(  text, ulIDText , sizeof(text),
     
    111121               hModule, hwnd, ulFlag);
    112122};
     123#endif
     124
     125/*!**************************************************/
     126/*                                                  */
     127/* @@DESC                                           */
     128/*                                                  */
     129/* Show a message box with text strings loaded from */
     130/* the resource DLL or the EXE file.                */
     131/* Unlike messagebox() no buffers must be given but */
     132/* only the string IDs. Max title length is 256,    */
     133/* max text length 256.                             */
     134/*                                                  */
     135/* @@PARAM                                          */
     136/*                                                  */
     137/* HWND hwnd input                                  */
     138/*                                                  */
     139/* Handle to a window. This will be the owner of    */
     140/* the message box.                                 */
     141/*                                                  */
     142/* @@PARAM                                          */
     143/*                                                  */
     144/* ULONG ulIDTitle input                            */
     145/*                                                  */
     146/* ID of the string to be used as the title.        */
     147/*                                                  */
     148/* @@PARAM                                          */
     149/*                                                  */
     150/* ULONG ulIDText input                             */
     151/*                                                  */
     152/* ID of the string to be used as the text.         */
     153/*                                                  */
     154/* @@PARAM                                          */
     155/*                                                  */
     156/* HMODULE hModule input                            */
     157/*                                                  */
     158/* Handle to a ressource DLL or NULLHANDLE. If      */
     159/* this parameter is null the strings will be       */
     160/* taken from ressources bound to the executable.   */
     161/*                                                  */
     162/* @@PARAM                                          */
     163/*                                                  */
     164/* ULONG ulFlags input                              */
     165/*                                                  */
     166/* Flags specifying the appearance of the message   */
     167/* box. See WinMessageBox() for more information.   */
     168/*                                                  */
     169/* @@RETURNS                                        */
     170/*                                                  */
     171/* ULONG ulResult                                   */
     172/*                                                  */
     173/* MBID_ERROR in case of an error. This may be      */
     174/* for example if the ressources can't be found.    */
     175/* :p.                                              */
     176/* Result code from WinMessageBox().                */
     177/*                                                  */
     178/* @@REMARKS                                        */
     179/*                                                  */
     180/* The parent of the message box is HWND_DESKTOP.   */
     181/*                                                  */
     182/*!!*************************************************/
     183ULONG MsgShowMessageBox(HWND hwnd, ULONG ulIDTitle, ULONG ulIDText, HMODULE hModule, ULONG ulFlag)
     184{
     185  char* pText;
     186  char* pTitle;
     187  ULONG rc;
     188
     189#define TLENGTH 256L
     190
     191  if(NULLHANDLE==(pText=malloc(TLENGTH*2*sizeof(char))))
     192    return MBID_ERROR;
     193
     194  pTitle=pText+TLENGTH*sizeof(char);
     195
     196  rc=mBox( pText, ulIDText , TLENGTH,
     197           pTitle, ulIDTitle, TLENGTH,
     198           hModule, hwnd, ulFlag);
     199
     200  free(pText);
     201  return rc;
     202};
     203
    113204
    114205/*!**************************************************/
     
    125216/* TRUE if string was found in the resource DLL or  */
    126217/* EXE file. FALSE otherwise.                       */
     218/*                                                  */
     219/* @@REMARKS                                        */
     220/*                                                  */
     221/* This function is obsolete.                       */
     222/* Use MsgGetMessage() instead.                     */
    127223/*                                                  */
    128224/*!!*************************************************/
     
    136232}
    137233
     234/*!***********************************************************/
     235/*                                                           */
     236/* Load a message string from a resource DLL or the          */
     237/* EXE file.                                                 */
     238/*                                                           */
     239/* @@RETURNS                                                 */
     240/*                                                           */
     241/* BOOL rc                                                   */
     242/*                                                           */
     243/* TRUE if string was found in the resource DLL or           */
     244/* EXE file. FALSE otherwise.                                */
     245/*                                                           */
     246/* @@REMARKS                                                 */
     247/*                                                           */
     248/* If an error occurs an empty string is placed in the       */
     249/* buffer.                                                   */
     250/*                                                           */
     251/*!!**********************************************************/
    138252BOOL MsgGetMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd)
    139253{
  • trunk/common_functions/rexx_funcs.c

    r2 r4  
    2525 } RXSTEMDATA;
    2626
     27/*!**************************************************/
     28/*                                                  */
     29/* @@DESC                                           */
     30/*                                                  */
     31/* To be written...                                 */
     32/*                                                  */
     33/*!!*************************************************/
    2734LONG RxGetLongFromStemWithoutNumber(RXSTRING args, char * chrTail, ULONG* ulError)
    2835{
     
    7481}
    7582
    76 /*************************************************************/
     83/*!***********************************************************/
     84/*                                                           */
     85/* @@DESC                                                    */
    7786/*                                                           */
    7887/* This function returns a string from a stem. The caller    */
    7988/* must free the returned string with free()                 */
    8089/*                                                           */
    81 /*************************************************************/
     90/*!!**********************************************************/
    8291PSZ RxGetStringFromStemWithoutNumber(RXSTRING args, char *chrTail, ULONG* ulError)
    8392{
     
    125134}
    126135
    127 /*************************************************************/
     136/*!***********************************************************/
     137/*                                                           */
     138/* @@DESC                                                    */
    128139/*                                                           */
    129140/* This function returns a long from a REXX var.             */
    130141/*                                                           */
    131 /*************************************************************/
     142/*!!**********************************************************/
    132143LONG RxGetLongFromVar(char * chrVar, ULONG* ulError)
    133144{
     
    175186}
    176187
     188/*!***********************************************************/
     189/*                                                           */
     190/* @@DESC                                                    */
     191/*                                                           */
     192/* To be written...                                          */
     193/*                                                           */
     194/*!!**********************************************************/
    177195LONG RxSetLongInRexxVar(char* chrVar, ULONG ulVal)
    178196{
  • trunk/common_functions/sys_funcs.c

    r2 r4  
    2222#endif
    2323 
    24   /**!**************************************************/
    25   /*                                                  */
    26   /* @@DESC                                           */
    27   /*                                                  */
    28   /* This funktion returns the drive letter of the    */
    29   /* boot partition.                                  */
    30   /*                                                  */
    31   /* @@RETURNS                                        */
    32   /*                                                  */
    33   /* char chrDrive                                    */
    34   /*                                                  */
    35   /* Drive from which the system was booted.          */
    36   /*                                                  */
    37   /**!!*************************************************/
     24/*!**************************************************/
     25/*                                                  */
     26/* @@DESC                                           */
     27/*                                                  */
     28/* This funktion returns the drive letter of the    */
     29/* boot partition.                                  */
     30/*                                                  */
     31/* @@RETURNS                                        */
     32/*                                                  */
     33/* char chrDrive                                    */
     34/*                                                  */
     35/* Drive from which the system was booted.          */
     36/*                                                  */
     37/*!!*************************************************/
    3838char SysQueryBootDriveLetter(void)
    3939{
     
    7373}
    7474
    75 /**!**************************************************/
     75/*
     76   Documentation script can't handle the const keyword yet!!!!
     77*/
     78/*--->!**************************************************/
    7679/*                                                  */
    7780/* @@DESC                                           */
     
    8790/* !parsing is broken at the moment because of const and (...)              */
    8891/*                                                  */
    89 /**!!*************************************************/
     92/*!!*************************************************/
    9093void SysWriteToTrapLog(const char* chrFormat, ...)
    9194{
     
    143146/* Size of the file.                                */
    144147/*                                                  */
     148/* @@REMARKS                                        */
     149/*                                                  */
     150/* In case of a nonexistant file 0 is returned. So  */
     151/* it's necessary to first check if the file exists.*/
     152/*                                                  */
    145153/*!!*************************************************/
    146154ULONG SysQueryFileSize(char* chrFileName)
     
    179187}
    180188
     189/*!**************************************************/
     190/*                                                  */
     191/* @@DESC                                           */
     192/*                                                  */
     193/* To be written...                                 */
     194/*                                                  */
     195/*!!*************************************************/
    181196ULONG SysQueryDriveType(ULONG ulDriveNum)
    182197{
     
    215230     
    216231      //      SysWriteToTrapLog("Drive nr.: %d, rc for DSK_BLOCKREMOVABLE-> ERROR_NOT_SUPPORTED\n", ulDriveNum);
    217       sprintf(chrDev, "%c:", 'a'+ulDriveNum-1);
     232      sprintf(chrDev, "%c:", 'a'+(char)(ulDriveNum-1));
    218233      cbBuf=sizeof(buf);
    219234     
     
    350365#endif
    351366
     367/*!**************************************************/
     368/*                                                  */
     369/* @@DESC                                           */
     370/*                                                  */
     371/* To be written...                                 */
     372/*                                                  */
     373/*!!*************************************************/
    352374ULONG SysQueryFreeDriveSpace(ULONG ulDriveNum, ULONG *ulTotal, ULONG * ulFree, ULONG* ulBytesUnit)
    353375{
     
    371393}
    372394
    373 /*
    374   The returned volname is always terminated by zero.
    375   ulDriveNum:  1...26
    376  */
    377 ULONG SysQueryDiskName(ULONG ulDriveNum, ULONG ulSize, char *chrBuffer)
     395/*!**************************************************/
     396/*                                                  */
     397/* @@DESC                                           */
     398/*                                                  */
     399/* This function returns the home directory of the  */
     400/* current user.                                    */
     401/*                                                  */
     402/* @@RETURNS                                        */
     403/*                                                  */
     404/* ULONG rc                                         */
     405/*                                                  */
     406/* NO_ERROR is returned if the function succeeds.   */
     407/*                                                  */
     408/* @@PARAM                                          */
     409/*                                                  */
     410/* ULONG ulDriveNum input                           */
     411/*                                                  */
     412/* The number of the drive to be queried (1-26).    */
     413/*                                                  */
     414/* @@PARAM                                          */
     415/*                                                  */
     416/* char* chrBuffer in/out                           */
     417/*                                                  */
     418/* Pointer to a buffer where the volume name will   */
     419/* be placed.                                       */
     420/*                                                  */
     421/* @@PARAM                                          */
     422/*                                                  */
     423/* ULONG ulSize input                               */
     424/*                                                  */
     425/* Size of the name buffer.                         */
     426/*                                                  */
     427/* @@REMARKS                                        */
     428/*                                                  */
     429/* The returned name is always terminated by zero.  */
     430/*                                                  */
     431/*!!*************************************************/
     432
     433ULONG SysQueryDiskName(ULONG ulDriveNum, char *chrBuffer, ULONG ulSize)
    378434{
    379435  FSINFO fsIBuf;
     
    394450}
    395451
     452/*!**************************************************/
     453/*                                                  */
     454/* @@DESC                                           */
     455/*                                                  */
     456/* This function returns the home directory of the  */
     457/* current user.                                    */
     458/*                                                  */
     459/* @@RETURNS                                        */
     460/*                                                  */
     461/* BOOL fSuccess                                    */
     462/*                                                  */
     463/* TRUE if the home dir is specified and does exist */
     464/*                                                  */
     465/* @@PARAM                                          */
     466/*                                                  */
     467/* char* chrBuf in/out                              */
     468/*                                                  */
     469/* Pointer to a buffer where the home directory     */
     470/* name will be placed.                             */
     471/*                                                  */
     472/* @@PARAM                                          */
     473/*                                                  */
     474/* ULONG ulSize input                               */
     475/*                                                  */
     476/* Size of the name buffer.                         */
     477/*                                                  */
     478/* @@REMARKS                                        */
     479/*                                                  */
     480/* The returned string is always terminated by zero.*/
     481/* .p:                                              */
     482/* If a directory is specified in the HOME          */
     483/* environment variable but doesn't exist FALSE is  */
     484/* returned and a message is written to the apps    */
     485/* exception log.                                   */
     486/*                                                  */
     487/*!!*************************************************/
    396488BOOL SysQueryHomeDir(char* chrBuf, ULONG ulSize)
    397489{
     
    400492  if(!chrHome || !chrBuf)
    401493    return FALSE;
    402 
    403 #if 0
    404   SysWriteToTrapLog("r:\\temp: %d , r:\\bla: %d \n",
    405                     SysCheckFileExists("r:\\temp"), SysCheckFileExists("r:\\bla"));
    406 #endif
    407494
    408495  if(strlcpy(chrBuf, chrHome, ulSize)>=ulSize) {
  • trunk/common_functions/uptime.c

    r2 r4  
    257257}
    258258
     259/*!***********************************************************/
     260/*                                                           */
     261/* @@DESC                                                    */
     262/*                                                           */
     263/* To be written...                                          */
     264/*                                                           */
     265/*!!**********************************************************/
    259266ULONG SysGetUptimeSecs(BOOL fUseTimer)
    260267{
     
    265272}
    266273
     274/*!***********************************************************/
     275/*                                                           */
     276/* @@DESC                                                    */
     277/*                                                           */
     278/* To be written...                                          */
     279/*                                                           */
     280/*!!**********************************************************/
    267281char* SysGetUptimeString(BOOL fUseTimer, char * chrBuffer, ULONG ulSize)
    268282{
  • trunk/make.inc

    r3 r4  
    11# List of languages to be built.
    2 LANGUAGES       =       de en nl it
     2LANGUAGES       =       de en nl it tw
    33
    44#define the next makro if compiling a release rather than a beta
     
    99#That's used for createcd.exe until I find a decent documentation for make to do it better...
    1010#Also used for including the right icons
    11 #ECS_COMPILE    =       YES
     11ECS_COMPILE     =       YES
    1212
    1313ifdef    ECS_COMPILE
     
    3636ECSMFLDRDIR = MediaFld
    3737
    38 #The base dir for additional functions for the MM helper programs
     38#The base dir off the CW function toolkit
    3939export COMMONSRC        =       H:/cwmm/common_functions
    4040
     41export NLVBASE          =       H:/cwmm/nlv
     42export MMSRCBASE        =       H:/cwmm
    4143
    4244
  • trunk/makefile

    r2 r4  
    2525        @echo ''
    2626        cd ./mediafolder && make
     27
     28nlv_tst:
     29#this is a target used to test NLV building outside the source tree
     30# Will eventually superseed nlv target.
     31        cd ./nlv && make
    2732
    2833nlv:
  • trunk/mediafolder/Help/makefile

    r2 r4  
    2121        ipfc mediafldr031_ecs.ipf mediafldr031.hlp
    2222        ipfc mediafldr039_ecs.ipf mediafldr039.hlp
     23        ipfc mediafldr088_ecs.ipf mediafldr088.hlp
    2324else
    2425        ipfc mediafldr.ipf
     
    2627        ipfc mediafldr031.ipf
    2728        ipfc mediafldr039.ipf
     29        ipfc mediafldr088.ipf
    2830endif
    2931
  • trunk/mediafolder/c/cddb/helper.c

    r2 r4  
    11/*
    2  * This file is (C) Chris Wohlgemuth 2001/2002
     2 * This file is (C) Chris Wohlgemuth 2001-2005
    33 */
    44/*
  • trunk/mediafolder/c/cddb/makefile

    r2 r4  
    11# Makefile for Audio-CD copy
    22
    3 CC           = icc
    4 LIB_DIR      = $d:/emx/lib
    5 #CPPFLAGS     = -Ge- /Gm+ -G4 -Gl  /O+ -Oc+ -Ol
     3include ../../../make.inc
     4
     5CC           = gcc
    66CPPFLAGS     = -O -Zomf -Zcrtdll -s
    77#CPPFLAGSSTATIC     = -O -Zomf -Zsys -Zmt -s
     
    99CPPFLAGSVAC  = /Ge- /Gm+ /G4 /Gl  /O+ /Oc+ /Ol- /Q+
    1010INC             = ../../include
     11MOREINC         = $(COMMONSRC)/include
    1112DEFS         =
    1213PROGS        = 
    1314ODIR            = .
    1415CPPDIR  = .
     16LIBDIR          =       ./lib
    1517BINDIR          =       ../../dist/bin
    1618HELPERDIR       =       ..\helper
     19OBJECTS         =       cddb.obj \
     20                        cd.obj \
     21                        helper.obj \
     22                        cddbhelper.obj \
     23                        message.obj
     24LIBOBJECTS      = $(LIBDIR)/sys_funcs.obj
    1725
    18 CPPFILES        =
    19 OBJECTS =        cddb.obj cd.obj helper.obj cddbhelper.obj message.obj
    2026#printHelper.obj
    2127#all:    querycddb.exe cddbcls.obj
    2228
    23 all:     pmcddb.exe pmdb001.dll pmdb049.dll pmdb031.dll pmdb039.dll
     29all:     pmcddb.exe pmdb001.dll pmdb049.dll pmdb031.dll pmdb039.dll pmdb088.dll
    2430
    25 nlv:    pmdb001.dll pmdb049.dll pmdb031.dll pmdb039.dll
     31nlv:    pmdb001.dll pmdb049.dll pmdb031.dll pmdb039.dll pmdb088.dll
    2632
    2733pmdb001.dll:    ./res/pmcddb001.c ./res/pmcddb001.res
     
    5359                cd ./Res && make
    5460
     61
     62
     63pmdb088.dll:    ./res/pmcddb088.c ./res/pmcddb088.res
     64                -rm pmdb088.dll
     65                cp ./res/pmcddb088.dll pmdb088.dll
     66
     67./res/pmcddb088.res:    ./res/pmcddb088.rc ./res/pmcddb088.dlg $(INC)/pmcddbres.h
     68                cd ./Res && make
     69
     70
     71$(LIBDIR)/%.obj:        $(COMMONSRC)/%.c
     72        $(CC) -c -Wall -o$@ -Zomf -I$(INC) -I$(MOREINC) $<
     73
    5574cd.obj: cd.c
    5675                gcc -c $< -I$(INC) -Zcrtdll -Zomf
    57 #               cd ../. && cd helper && make
    5876
    5977helper.obj:     helper.c
     
    6381                gcc -c $< -I$(INC) -Zcrtdll -Zomf
    6482
    65 pmcddb.exe:     pmcddb.cc $(OBJECTS) $(CDDBOBJ) $(INC)\cddb.h $(INC)\cddb.hh
    66         gcc $< $(CPPFLAGS) -I$(INC)  $(OBJECTS) $(CDDBOBJ)  -lsocket pmcddb.def
     83pmcddb.exe:     pmcddb.cc $(OBJECTS) $(LIBOBJECTS) $(CDDBOBJ) $(INC)\cddb.h $(INC)\cddb.hh
     84        $(CC) $< $(CPPFLAGS) -I$(INC) -I$(MOREINC) $(LIBOBJECTS) $(OBJECTS) $(CDDBOBJ)  -lsocket pmcddb.def
    6785
    6886cddb.obj:       cddb.cpp $(INC)\cddb.hh
  • trunk/mediafolder/c/cddb/pmcddb.cc

    r2 r4  
    105105HMODULE RESSOURCEHANDLE=0;
    106106
    107 char logName[CCHMAXPATH]="Cddb.log";
     107char logName[CCHMAXPATH]=PMCDDB_LOGFILENAME;
     108char logNameFullPath[CCHMAXPATH];
    108109
    109110#define QUERYCDDB_VERSION "0.1"
     
    616617  /* argv[0]: progname
    617618   * argv[1]: cd drive or /C for configuring
    618    * argv[2]: REXX file
     619   * argv[2]: REXX file. This file is used to parse the queried data file and
     620   *          set all the info of the CD track objects.
     621   *          When configuring argv[2] is the email address.
    619622   * argv[3]: folder path
    620623   */
    621624
    622625  numArgs=argc;
    623 
    624626
    625627  for(a=0;a<argc;a++)
     
    632634    *chrPtr=0;
    633635  strncpy(chrInstallDir, chrBinDir, sizeof(chrInstallDir)-1);
    634   /*  if((chrPtr=strrchr(chrInstallDir, '\\'))!=NULLHANDLE)
    635    *chrPtr=0;*/
    636636
    637637  if(numArgs<3) {
  • trunk/mediafolder/c/cddb/res/makefile

    r2 r4  
    1313
    1414CPPFILES        =
    15 all:     pmcddb001.dll pmcddb049.dll pmcddb031.dll pmcddb039.dll
     15all:     pmcddb001.dll pmcddb049.dll pmcddb031.dll pmcddb039.dll pmcddb088.dll
    1616
    1717
     
    5050                rc  -i $(INC) -r pmcddb039.rc
    5151
     52pmcddb088.dll:  pmcddb088.c pmcddb088.res
     53                gcc -Zdll -Zomf -Zno-rte -I$(INC) pmcddb088.c pmcddb088.def
     54                rc pmcddb088.res pmcddb088.dll
     55
     56pmcddb088.res:  pmcddb088.rc pmcddb039.dlg $(INC)\pmcddbres.h
     57                rc  -i $(INC) -r pmcddb088.rc
     58
    5259clean:
    5360        -rm *.obj
  • trunk/mediafolder/c/cddb/res/pmcddb049.rc

    r2 r4  
    3535IDSTR_PMCDDBTITLE         "FreeDB Abfrage" 
    3636
    37 IDSTR_USAGE               "Email-Adresse mit folgender Option festlegen:  /C <email address> "
     37IDSTR_USAGE               "Email-Adresse mit folgender Option festlegen:  /C <Email-Adresse> "
    3838IDSTR_SETUPERROR         "Der Username oder der Host wurden nicht festgelegt. Pmcddb.exe mit Parameter /C starten, um die Adresse festzulegen."
    3939END
    4040
    4141RCINCLUDE "pmcddb049.dlg"
    42 
  • trunk/mediafolder/c/cdfldr/cdfolder.cpp

    r2 r4  
    11/*
    2  * This file is (C) Chris Wohlgemuth 2002
     2 * This file is (C) Chris Wohlgemuth 2002-2005
    33 *
    44 * It's part of the Media-Folder distribution
     
    7373          //        if(a==1)
    7474          //        WinMessageBox(HWND_DESKTOP,HWND_DESKTOP, chrSetup, "", 12324, MB_MOVEABLE);
    75           sprintf(chrTitle,"Track %d",a);
     75          sprintf(chrTitle,"Track %02d",a);
    7676          WinCreateObject("MMCDTrack", chrTitle, chrSetup, chrTarget, CO_REPLACEIFEXISTS);
    7777        }
  • trunk/mediafolder/c/cdfldr/cdfolderoverriddenwpmethods.cpp

    r2 r4  
    11/*
    2  * This file is (C) Chris Wohlgemuth 2002-2003
     2 * This file is (C) Chris Wohlgemuth 2002-2005
    33 *
    44 * It's part of the Media-Folder distribution
     
    5757extern void showPlayTimeDisplay(CWMediaFolder *thisPtr, BOOL bShow);
    5858void setPlayTimeText2(CWMediaFolder *thisPtr, char * theText);
    59 void HlpWriteToTrapLog(const char* chrFormat, ...);
     59
    6060/* Get the HWND of the play control dialog. This Dialog is on top of
    6161   the top frame control. */
     
    344344    }
    345345  case PLAY_NEXT:
     346  case PLAY_NEXT_CDFLDR:
    346347    if(iWave==0)
    347348      return cwPlayAudioFile(hwndFrame, PLAY_FIRST);/* Not yet playing */
     
    450451  }/* switch */
    451452
    452   if(!getMessage(chrCommand, IDSTR_STARTINGTRACK, sizeof(chrCommand), queryResModuleHandle(),  hwndFrame))
    453     sprintf(chrCommand, "Starting track...");
    454   setPlayTimeText2(this, chrCommand);
     453  //  if(ulWhich!=PLAY_NEXT_CDFLDR) {
     454    if(!getMessage(chrCommand, IDSTR_STARTINGTRACK, sizeof(chrCommand), queryResModuleHandle(),  hwndFrame))
     455      sprintf(chrCommand, "Starting track...");
     456    setPlayTimeText2(this, chrCommand);
     457    // }
    455458
    456459  strncpy(chrDevice,"CDAUDIO", sizeof(chrDevice));
     
    519522  }/*   if( ...|| !mrcPlaying) */
    520523
    521   if(iPrevTrack+1==iTime2) {
     524  if(iPrevTrack+1==iTime2 && ulWhich!=PLAY_NEXT_CDFLDR) {
    522525    /* Previous track ended, now playing the next. Or user pressed 'Next' while playing */
    523526    if(ulPos*1000 < ulTotalLength) {
     
    539542        return 0;
    540543      }
    541       //  HlpWriteToTrapLog("\n2\n");
    542     }
    543   }
    544 
    545   //  HlpWriteToTrapLog("About to get length...\n");
     544    }
     545  }
    546546
    547547  /* Get length in ms */
     
    552552  }
    553553
    554   // HlpWriteToTrapLog("iTime2: %d\n", iTime2);
    555 
    556554  sprintf(chrCommand,"%d:%02d  %d:%02d  -%d:%02d", iTime2/60, iTime2%60,
    557555          0, 0,
    558556          iTime2/60, iTime2%60);
    559557
    560   //  HlpWriteToTrapLog("chrCommand: %s\n", chrCommand);
    561558 
    562559  //  WinSetWindowText(WinWindowFromID(hwndTop, IDST_PLAYTIME), chrCommand);
     
    658655  int iCurrentTrack;
    659656
     657  //SysWriteToTrapLog("\n%s:\n", __FUNCTION__);
     658
    660659  sprintf(chrCommand,"STATUS wave%d MODE WAIT", iWave);
    661660  rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), 0, 0);
     
    688687  else {
    689688    iCurrentTrack=atoi(retMsg);
     689    //SysWriteToTrapLog(" iWave: %d. iPrevTrack: %d, iCurrentrack: %d\n", iWave, iPrevTrack, iCurrentTrack);
    690690    /* Timeout. Check if track is still playing */
    691691    if(iCurrentTrack==iPrevTrack+1) {
    692692      /* Audio file played. Start next */
    693       cwPlayAudioFile(hwndFrame, PLAY_NEXT);
    694     }
    695   }
    696 }
    697 
    698 
    699 
    700 
    701 
    702 
    703 
    704 
    705 
     693      //SysWriteToTrapLog(" iWave: %d. iPrevTrack: %d, iCurrentrack: %d, startinb next (%d)\n", iWave, iPrevTrack, iCurrentTrack, __LINE__);
     694      cwPlayAudioFile(hwndFrame, PLAY_NEXT_CDFLDR);
     695    }
     696  }
     697}
     698
     699
     700
  • trunk/mediafolder/c/createcd/createcd.c

    r2 r4  
    11/*
    2  * This file is (C) Chris Wohlgemuth 1999-2002
     2 * This file is (C) Chris Wohlgemuth 1999-2005
    33 */
    44/*
     
    2929#include <string.h>
    3030#include "mediafolderinc.h"
     31#include "mediafolderres.h"
     32/* #include "sys_funcs.h" */
    3133
    3234#define  LVM_IS_HARDDISK  0 
     
    9294PFNVIR pfnvirGet_Volume_Information=NULLHANDLE;
    9395
    94 BOOL loadLVMFuncs(void)
     96size_t strlcpy(char *dst, const char *src, size_t siz);
     97
     98/*
     99  FIXME:
     100
     101  Use the function from the \common_funcs directory instead.
     102 */
     103static BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource)
     104{
     105  char* pOffset;
     106  char* ptr;
     107  int id=0;
     108
     109  text[0]='\0';
     110
     111  // printf("resource: %x, %d %d\n", hResource, ulID, (ulID/16)+1,
     112  // DosGetResource(hResource, RT_STRING, (ulID/16)+1, (PVOID)&pOffset));
     113
     114  if(DosGetResource(hResource, RT_STRING, (ulID/16)+1, (PVOID)&pOffset)!=NO_ERROR)
     115    return FALSE;
     116
     117  ptr=pOffset;
     118
     119  //printf("\ngot resource...\n");
     120
     121  /* Parsing... */
     122  id=ulID%16;
     123
     124  //printf("id: %d\n", id);
     125  pOffset+=sizeof(USHORT); /* Skip codepage */
     126
     127  for(;id > 0;id--)
     128    {
     129      //printf("id: %d, length: %d %s\n", id, *pOffset, pOffset+1);
     130      pOffset+=*pOffset+1;
     131    }
     132  //printf("length: %d %s\n",  *pOffset, pOffset+1);
     133  strlcpy(text, pOffset+1, lSizeText);
     134
     135  if(*pOffset!=1){
     136    DosFreeResource(ptr);
     137  return TRUE;
     138  } 
     139  DosFreeResource(ptr);
     140/* Length=1 means dummy entry filled by system */
     141  return FALSE;
     142}
     143
     144#if 0
     145#pragma import(DosQueryModFromEIP,,"DOSCALL1",360)
     146 APIRET APIENTRY DosQueryModFromEIP ( HMODULE *phMod, ULONG *pObjNum, ULONG BuffLen, PCHAR pBuff, ULONG *pOffset, PVOID Address ) ;
     147#endif
     148
     149/* This function returns the module handle of our ressource dll */
     150static HMODULE queryResModuleHandle(void)
     151{
     152  char path[CCHMAXPATH]; 
     153  char buf[CCHMAXPATH];
     154  char* found;
     155  APIRET rc;
     156  HMODULE RESSOURCEHANDLE;
     157  HMODULE hmod;
     158  PTIB   ptib = NULL;
     159  PPIB   ppib = NULL;
     160 
     161 
     162  // printf("rc=%d\n",DosQueryModFromEIP( &hmod, &ul, sizeof(path), path,
     163  //                  &off, (PVOID)queryResModuleHandle ) );
     164  if(NO_ERROR==DosGetInfoBlocks(&ptib, &ppib))
     165    DosQueryModuleName (ppib->pib_hmte,         /* Module handle to query     */
     166                        sizeof(path),           /* Maximum length of result   */
     167                        path);
     168 
     169  //printf("%s %x\n",path, hmod);
     170
     171  /* Get the language code of our system and load the 
     172     resource DLL with the right language */
     173  do
     174    {
     175      static char chrLang[]="en_EN";
     176      PSZ pszLang="";
     177      char *chrPtr;
     178       
     179      /* Get Language var */
     180      if(NO_ERROR!=DosScanEnv("LANG", &pszLang)) {
     181        pszLang=chrLang;
     182      }       
     183      /* Skip leading spaces */
     184      chrPtr=pszLang;
     185      while(*chrPtr==' ')
     186        chrPtr++;
     187       
     188      /* Check if value seems to be valid. The var must be something like xx_XX thus length is 5 */
     189      if(strlen(chrPtr)<5)
     190        break;
     191       
     192      if((found=strrchr(path, '\\'))!=NULLHANDLE)
     193        *found=0;
     194
     195      /* Extract the first two chars and build DLL name */               
     196      sprintf(buf, RESDLLNAME, chrPtr[0], chrPtr[1]);
     197      strcat(path,buf);
     198       
     199      rc=DosLoadModule(buf,sizeof(buf),path, &RESSOURCEHANDLE);
     200      if(rc==NO_ERROR)
     201        break;
     202               
     203      /* NLS DLL not found. Try to load default */
     204      found=strrchr(path,'\\');
     205      if(!found)
     206        break;
     207       
     208      *found=0;
     209      sprintf(buf, DEFRESDLLNAME);
     210      strcat(path,buf);
     211       
     212      rc=DosLoadModule(buf,sizeof(buf),path, &RESSOURCEHANDLE);
     213      if(rc!=NO_ERROR) {
     214        RESSOURCEHANDLE=NULLHANDLE;
     215      }
     216      else {
     217        //  printf("Ressource DLL loaded.\n");
     218      }
     219      break;
     220    }while(TRUE);
     221 
     222  return RESSOURCEHANDLE;
     223}
     224
     225 
     226static BOOL loadLVMFuncs(void)
    95227{
    96228  char chrErrorObject[CCHMAXPATH]={0};
     
    173305}
    174306
    175 int main(void)
     307int main(int argc, char** argv)
    176308{
    177309  CARDINAL32 error;
    178310  int iNumCD;
    179311  char cFirst;
    180   char setup[100];
    181   char name[100];
    182   char id[40];
     312  char setup[512];
     313  char name[256];
     314  char id[100];
     315  char nameTemplate[256];
    183316  int a;
     317  HMODULE hmodRes=NULLHANDLE;
    184318
    185319  if(!CDQueryCDDrives(&iNumCD, &cFirst))
    186320    exit(1);
     321
     322  hmodRes=queryResModuleHandle();
     323
     324  if(!getMessage(nameTemplate, /* IDSTR_LAUNCHPADFLYOVER */ IDSTR_CDFOLDERNAME, sizeof(nameTemplate), hmodRes))
     325    strncpy(nameTemplate, "CD-Audio player^Drive %c:", sizeof(nameTemplate));
    187326
    188327  if(!loadLVMFuncs()) {
     
    190329      int b;
    191330      /* Build folder name */
    192       sprintf(name, "CD-Audio^Drive %c:", cFirst+a);
     331      sprintf(name, nameTemplate, cFirst+a);
    193332      /* Build object ID */
    194333      sprintf(id, CDFLDR_ID, cFirst+a);
     
    231370
    232371              /* Build folder name */
    233               sprintf(name, "CD-Audio^Drive %c:", vir.Current_Drive_Letter);
     372              sprintf(name, nameTemplate, vir.Current_Drive_Letter);
    234373              /* Build object ID */
    235374              sprintf(id, CDFLDR_ID, vir.Current_Drive_Letter);
     
    242381                if(WinCreateObject(CDFLDR_CLASSNAME, name, setup, CDFLDR_LOCATION, CO_UPDATEIFEXISTS))
    243382                  break;
    244 
    245383                //      printf("Found:  %s, %s\n", name, setup);
    246384                DosSleep(5000);
     
    255393    DosFreeModule(hMod);
    256394  } /* else */
     395  if(hmodRes)
     396    DosFreeModule(hmodRes);
    257397  return (0);
    258398}
    259399
    260400
     401/********************************************************************/
     402/*      $OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $     */
     403
     404/*
     405 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
     406 *
     407 * Permission to use, copy, modify, and distribute this software for any
     408 * purpose with or without fee is hereby granted, provided that the above
     409 * copyright notice and this permission notice appear in all copies.
     410 *
     411 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     412 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     413 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     414 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     415 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     416 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     417 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     418 */
     419
     420
     421/*
     422 * Copy src to string dst of size siz.  At most siz-1 characters
     423 * will be copied.  Always NUL terminates (unless siz == 0).
     424 * Returns strlen(src); if retval >= siz, truncation occurred.
     425 */
     426static size_t
     427strlcpy(char *dst, const char *src, size_t siz)
     428{
     429        register char *d = dst;
     430        register const char *s = src;
     431        register size_t n = siz;
     432
     433        /* Copy as many bytes as will fit */
     434        if (n != 0 && --n != 0) {
     435                do {
     436                        if ((*d++ = *s++) == 0)
     437                                break;
     438                } while (--n != 0);
     439        }
     440
     441        /* Not enough room in dst, add NUL and traverse rest of src */
     442        if (n == 0) {
     443                if (siz != 0)
     444                        *d = '\0';              /* NUL-terminate dst */
     445                while (*s++)
     446                        ;
     447        }
     448
     449        return(s - src - 1);    /* count does not include NUL */
     450}
     451
  • trunk/mediafolder/c/mediafldr/mediadialogprocs.cpp

    r3 r4  
    405405        thisPtr->usLastSelMenuItem=SHORT1FROMMP(mp1);
    406406      break;
     407    case WM_TIMER:
     408      /* The user didn't click any button on the message box asking for closing the
     409         folder. Now the system forces the closing so automatic shutdown may finally
     410         succeed. */
     411      if(SHORT1FROMMP(mp1)==MFLDR_MBOX_TIMER_ID) {
     412        WinStopTimer(WinQueryAnchorBlock(HWND_DESKTOP), hwnd, MFLDR_MBOX_TIMER_ID);
     413        WinPostMsg(hwnd, WM_CLOSE, 0, 0);
     414      }
     415      return MRFALSE;
    407416    default:
    408417      break;
  • trunk/mediafolder/c/mediafldr/mediafolderoverridenwpmethods.cpp

    r3 r4  
    311311  hwnd=CWProgFolder::wpOpen(hwndCnr, ulView, ulParam);
    312312
    313   /* Save this ptr */
    314   //  WinSetWindowULong( hwnd, ulQWP_THISPTR, (ULONG)this);
    315    
    316313  /* Only subclass folder frames, not settings notebooks */
    317314  if(ulView!=OPEN_SETTINGS){
     
    409406      }/* menu hwnd */
    410407
    411       //#if 0     
    412408      /* Subclass container for tabbing */
    413409      myFrameCtrlHWND=WinWindowFromID(hwnd,FID_CLIENT);//Get container hwnd
     
    419415      }
    420416
    421       //#endif
    422417      /* Now add the framecontrols */
    423418
     
    13521347
    13531348  /* Check if we currently play a song */
    1354   if(iWave) {
     1349  if(iWave && !(ulPrivFlags & MFLDR_SHOWING_MBOX)) {
     1350    LONG lDelay;
     1351
     1352#if 0
    13551353    PVIEWITEM pViewItem;
    13561354    int a=0;
    1357 
    1358 #if 0
    13591355    /* Check if we close a settings view or a folder view. */
    13601356    for(pViewItem=wpFindViewItem(VIEW_ANY, NULLHANDLE); pViewItem; pViewItem=wpFindViewItem(VIEW_ANY, pViewItem))
     
    13701366      hwndOwner=hwndFrame;
    13711367
     1368    /* Start a timer which will cause the folder to close automatically after some time even
     1369       if the user doesn't click any button. Get the timeout from the INI file if available. */
     1370    if((lDelay=PrfQueryProfileInt(HINI_USERPROFILE, "CWMM", MFLDR_TIMER_DELAY_KEY, MFLDR_MBOX_TIMER_DELAY))
     1371       < MFLDR_MBOX_MIN_TIMER_DELAY)
     1372      lDelay=MFLDR_MBOX_MIN_TIMER_DELAY;
     1373
     1374    WinStartTimer(WinQueryAnchorBlock(HWND_DESKTOP), hwndFrame, MFLDR_MBOX_TIMER_ID, lDelay);
     1375    ulPrivFlags|= MFLDR_SHOWING_MBOX;
     1376    /* Ask user if he really wants to stop playing and close the folder */
    13721377    if(messageBox( text, IDSTR_CLOSETEXT, sizeof(text),
    13731378                   title, IDSTR_CLOSETITLE, sizeof(title),
    1374                    queryResModuleHandle(), hwndOwner, MB_YESNO|MB_MOVEABLE|MB_ICONQUESTION)==MBID_NO)
     1379                   queryResModuleHandle(), hwndOwner, MB_YESNO|MB_MOVEABLE|MB_ICONQUESTION)==MBID_NO) {
     1380      WinStopTimer(WinQueryAnchorBlock(HWND_DESKTOP), hwndFrame, MFLDR_MBOX_TIMER_ID);
     1381      ulPrivFlags&= ~MFLDR_SHOWING_MBOX;
    13751382      return FALSE;
     1383    }
    13761384  }
    13771385  cwStopAudioFile(hwndFrame); 
     
    13841392  }
    13851393
    1386   ulPrivFlags&= ~MFLDR_VIEW_COMPACT;
     1394  ulPrivFlags&= ~(MFLDR_VIEW_COMPACT|MFLDR_SHOWING_MBOX);
    13871395  hwndMFldrFrame=NULL;
    13881396  wpSaveDeferred();
     
    13931401{
    13941402  ULONG ulErr;
     1403  /*
     1404    FIXME:
     1405    This init call of the parent should be changed to allow replacement of
     1406    CWProgFolder.
     1407    */
    13951408  CWProgFolder::wpInitData();
    13961409  /* Get storage for private data. */
     
    13991412
    14001413  ulPrivFlags=0;
    1401 
    14021414}
    14031415
    14041416void  CWMediaFolder::wpUnInitData()
    14051417{
    1406   wpFreeMem((PBYTE)mfData);
     1418  if(mfData)
     1419    wpFreeMem((PBYTE)mfData);
     1420
     1421  /*
     1422    FIXME:
     1423    This uninit call of the parent should be changed to allow replacement of
     1424    CWProgFolder.
     1425    */
    14071426  CWProgFolder::wpUnInitData();
    14081427}
    14091428
     1429
     1430
     1431
     1432
  • trunk/mediafolder/include/mediafolder.hh

    r3 r4  
    11/*
    2  * This file is (C) Chris Wohlgemuth 2002
     2 * This file is (C) Chris Wohlgemuth 2002-2005
    33 */
    44/*
     
    6464#define SHOWABOUTDIALOG_COMMAND   "SHOWABOUTDIALOG=1"
    6565#define SETUP_SHOWABOUTDIALOG     "SHOWABOUTDIALOG"
    66 
    67 /*** Private folder flags: ***/
    68 
    69 /* Flag indicating from where a method was called */
    70 #define MFLDR_CURACTION_ADDFOLDERVIEW3  0x00000001
    71 /* Flag telling if folder is in compact view */
    72 #define MFLDR_VIEW_COMPACT              0x00000002
    73 /* The view is currently changing */
    74 #define MFLDR_CHANGING_VIEW             0x00000004
    75 /*** End of private folder flags ***/
    76 
    77 #define IDHLP_MEDIAFOLDERMAIN  100
    78 
    7966
    8067#pragma SOMAsDefault(on)
  • trunk/mediafolder/include/mediafolderinc.h

    r2 r4  
    3939/* Random play */
    4040#define FLAG_RANDOM            0x00000004
     41
     42/*** Private folder flags: ***/
     43/* Flag indicating from where a method was called */
     44#define MFLDR_CURACTION_ADDFOLDERVIEW3  0x00000001
     45/* Flag telling if folder is in compact view */
     46#define MFLDR_VIEW_COMPACT              0x00000002
     47/* The view is currently changing */
     48#define MFLDR_CHANGING_VIEW             0x00000004
     49/* Indicate, we are currently showing the cancellation message box to the user */
     50#define MFLDR_SHOWING_MBOX              0x00000008
     51/*** End of private folder flags ***/
     52
     53/* Timer for automatically dismissing the message box and closing a mediafolder
     54   when playing a media file. Used for enabling automatic shutdown. Otherwise
     55the shutdown would hang until the user clicks 'ok'. See cwClose() */
     56#define MFLDR_MBOX_TIMER_ID 100
     57/* The timer delay in ms. This can be set in the INI file. */
     58#define MFLDR_MBOX_TIMER_DELAY 60000
     59/* The allowed minimum for the timer delay in ms */
     60#define MFLDR_MBOX_MIN_TIMER_DELAY 5000
     61/* */
     62#define MFLDR_TIMER_DELAY_KEY "mfldrMBoxDisplayTime"
     63
     64#define IDHLP_MEDIAFOLDERMAIN  100
    4165
    4266/* Which display to show */
     
    112136
    113137/* Which track to start */
    114 #define PLAY_FIRST    1L
    115 #define PLAY_NEXT     2L
    116 #define PLAY_PREV     3L
    117 #define PAUSE_TRACK   4L
    118 #define STOP_TRACK    5L
    119 #define SEEK_TRACK    6L
     138#define PLAY_FIRST       1L
     139#define PLAY_NEXT        2L
     140#define PLAY_PREV        3L
     141#define PAUSE_TRACK      4L
     142#define STOP_TRACK       5L
     143#define SEEK_TRACK       6L
     144#define PLAY_NEXT_CDFLDR 7L /* CD folders need special handling because they're slow */
    120145
    121146/* The IDs for the playtime display */
  • trunk/mediafolder/include/mediafolderres.h

    r2 r4  
    2525#define IDSTR_VIEWPAGENAME         24 /* Title for Details view page which has now a major tab */
    2626#define IDSTR_VIEWCOMPACT          25 /* View name when in 'Compact' mode */
     27#define IDSTR_CDFOLDERNAME         26
    2728
    2829#define IDPB_VOLUME                 202
  • trunk/mediafolder/include/pmcddb.h

    r2 r4  
    4747
    4848#define IDINFO_LASTINFO          10
     49
     50#define PMCDDB_LOGFILENAME       "freedb.log"
     51#define PMCDDB_INIFILENAME       "freedb.ini"
  • trunk/mediafolder/prog_tutorial/hiddenfeatures.inc

    r2 r4  
    9999x=50% width=50%
    100100group=2
    101 .Replace M3U olayer
     101.Replace M3U player
    102102:p.
    103103The default M3U player may be replaced by adding the
     
    262262:exmp.
    263263
     264
     265:h2 res=424
     266x=50% width=50%
     267group=2
     268.Set time for message box display
     269:p.
     270The confirmation message box shown when closing a mediafolder while playing a track automatically closes after 60s and the
     271folder will be closed. This delay may be changed by setting the following key.
     272
     273:p.
     274:hp2.CWMM->mfldrMBoxDisplayTime-><time in milli seconds>:ehp2.
     275:nt.Be sure to keep the uppercase characters!
     276:ent.
     277:nt.The shortest allowed time is 5000ms.
     278:ent.
     279
     280.* last id 424
  • trunk/mediafolder/prog_tutorial/mediafldrprog.ipf

    r2 r4  
    517517:li.:link reftype=hd res=420.Disable audio file checking:elink.
    518518:li.:link reftype=hd res=421.Disable ID3 tag reading:elink.
     519:li.:link reftype=hd res=422.Set time for message box display:elink.
    519520:eul.
    520521
  • trunk/mediafolder/res/de/mediafolder_de.rc

    r2 r4  
    8181IDSTR_VIEWPAGENAME       "~Anzeige"
    8282IDSTR_VIEWCOMPACT        "Kompakt"
     83IDSTR_CDFOLDERNAME       "Audio-CD-Spieler^Laufwerk %c:"
    8384
    8485END
  • trunk/mediafolder/res/en/mediafolder_en.rc

    r2 r4  
    8383IDSTR_VIEWPAGENAME       "~View"
    8484IDSTR_VIEWCOMPACT        "Compact"
     85IDSTR_CDFOLDERNAME       "CD-Audio player^Drive %c:"
    8586
    8687END
  • trunk/mediafolder/res/it/mediafolder_it.rc

    r2 r4  
    7171IDSTR_VIEWPAGENAME       "~Visualizzazione"
    7272IDSTR_VIEWCOMPACT        "Compatta"
     73IDSTR_CDFOLDERNAME       "CD-Audio player^Drive %c:"
    7374
    7475END
  • trunk/mediafolder/res/nl/mediafolder_nl.rc

    r2 r4  
    8383IDSTR_VIEWPAGENAME       "O~verzicht"
    8484IDSTR_VIEWCOMPACT        "Compact"
     85IDSTR_CDFOLDERNAME       "CD-Audio player^Drive %c:"
    8586
    8687END
  • trunk/stream_ioproc/source/makefile

    r2 r4  
    3232#################################################################################
    3333#
    34 # Makefile for JPG IOProc
     34# Makefile for STREAM IOProc
    3535#
    3636#   Generates
    37 #         JPEGIO.dll       - JPG Image IOproc
     37#         STREAMIO.dll       - Stream storage IOproc
    3838#
    39 # Copyright Chris Wohlgemuth 2002
     39# Copyright Chris Wohlgemuth 2005
    4040#
    4141# http://www.os2world.com/cdwriting
     
    100100        -rm *.*~
    101101        -rm *.map
    102         -rm *.sym
     102        -rm *.sym
  • trunk/stream_ioproc/source/streamfunc.c

    r2 r4  
    11/*
    2  * Copyright (c) Chris Wohlgemuth 2002
     2 * Copyright (c) Chris Wohlgemuth 2005
    33 * All rights reserved.
    44 *
  • trunk/stream_ioproc/source/streamio.def

    r2 r4  
    3131; */
    3232LIBRARY STREAMIO INITINSTANCE TERMINSTANCE
    33 DESCRIPTION '$@#(C) C. Wohlgemuth 2003:#@##1## 13.07.2002 15:17:00      My ;-)  : :::0::@@ Stream IO procedure V0.1.0'
     33DESCRIPTION '$@#(C) C. Wohlgemuth 2005:#@##1## 13.05.2005 15:17:00      My ;-)  : :::0::@@ Stream IO procedure V0.1.0'
    3434DATA MULTIPLE NONSHARED
    3535SEGMENTS
  • trunk/stream_ioproc/source/streamproc.c

    r2 r4  
    11/*
    2  * Copyright (c) Chris Wohlgemuth 2002
     2 * Copyright (c) Chris Wohlgemuth 2005
    33 * All rights reserved.
    44 *
  • trunk/stream_ioproc/source/streamproc.h

    r2 r4  
    7676#endif
    7777
    78 #define     FOURCC_STREAM               mmioFOURCC('C', 'A', 'S', 'T')
     78#define     FOURCC_STREAM               mmioFOURCC('S', 'T', 'R', 'M')
    7979
    8080/* RC file defines */
    8181
    82 #define     HEX_FOURCC_STREAM           0x54534143L
     82/* #define     HEX_FOURCC_STREAM           0x54534143L */
     83#define     HEX_FOURCC_STREAM           0x4d5453L
    8384
    8485#define     MMOTION_IOPROC_NAME_TABLE   7000
  • trunk/stream_ioproc/source/testproc.c

    r2 r4  
    8989  LONG lNum=0;
    9090
     91  printf("In %s().\n", __FUNCTION__);
     92
     93  memset( &mmfinfo, '\0', sizeof(MMFORMATINFO) );
     94  // mmfinfo.ulIOProcType=MMIO_IOPROC_STORAGESYSTEM;
     95  //mmfinfo.ulMediaType=MMIO_MEDIATYPE_AUDIO;
     96
     97  mmioQueryFormatCount(&mmfinfo, &lNum, 0, 0);
     98  return lNum;
     99}
     100
     101int queryNumFormatProcs(void)
     102{
     103  MMFORMATINFO mmfinfo;
     104  LONG lNum=0;
     105
    91106  memset( &mmfinfo, '\0', sizeof(MMFORMATINFO) );
    92107  mmfinfo.ulIOProcType=MMIO_IOPROC_STORAGESYSTEM;
     
    127142          printf("%2d: %s\n", a+1, name);
    128143        }
     144      else
     145        printf("%2d: Can't get format name\n", a+1);
    129146      pmmfi++;
    130147    }
     
    136153    ULONG ulFlags = 0L;
    137154    ULONG rc;
     155
    138156#if 0
    139157
     
    189207}
    190208
     209void checkForIOProc(FOURCC fourcc1)
     210{
     211  PMMIOPROC  pIOProc1=NULLHANDLE;
     212  ULONG      ulFlags;
     213
     214  ulFlags= MMIO_FINDPROC;
     215  pIOProc1= mmioInstallIOProc (fourcc1, pIOProc1, ulFlags);
     216  //  pIOProc1= mmioInstallIOProc (0x4745504a, pIOProc1, ulFlags);
     217  if (!pIOProc1)
     218    /* I/O Procedure NOT FOUND */
     219    printf("IO-Proc NOT found 0x%x 0x%x\n", pIOProc1, fourcc1);
     220  else
     221    printf("IO-Proc found!!!\n");
     222      /* I/O Procedure found */
     223}
    191224int main(int argc, char **argv) {
    192225
    193   printf("Test stream io proc...\n");
     226  printf("Test stream io proc...\n\n");
    194227 
    195   printf("Installed storage procs: %d\n", queryNumStorageProcs());
     228  printf("Number of installed storage procs: %d\n", queryNumStorageProcs());
    196229  getFormats(queryNumStorageProcs());
     230  checkForIOProc(mmioStringToFOURCC("WAVE",0));
    197231
    198232  //  getFormats(45);
  • trunk/todo.txt

    r3 r4  
    1111
    1212cwimage:
    13 Create bitmap thread my not be thread safe.
     13Create bitmap thread may not be thread safe.
    1414
    1515Delete main bitmap handle after creating a new one for the caller in
     
    2121
    2222
    23 
     23mmfind_nl.rc/dlg must be translated.
     24
     25Position of audio-info control may be wrong in other languages.
     26
     2727.08.06:
     28
     29wpQueryBitmapHandle(): if size is zero don't scale. ATM no bmp is created at all.
Note: See TracChangeset for help on using the changeset viewer.