Changeset 4 for trunk/classes/c/c_video


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/classes/c/c_video
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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/*
Note: See TracChangeset for help on using the changeset viewer.