Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: MCI Video Wrapper

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,146
    Rep Power
    735

    MCI Video Wrapper

    MCI Video Wrapper

    Set of functions based on Multimedia Control Interface.
    Include file allows to play movie files inside ThinBasic UI windows or even controls.
    This function set is used in multiple ThinBasic projects, but I thought it is good idea to keep latest version on one place ... here

    Author: Mike Hartlef, few modifications by Psch


    Latest update
    27-06-2008
    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,814
    Rep Power
    10

    Re: MCI Video Wrapper

    This interface can be considered for a dedicated module.
    I will see if I can work on this for next thinBasic release.

    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    404

    Re: MCI Video Wrapper

    THanks Petr and Mike. Glad it will be a new module for us Eros in future releases.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  4. #4
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    58
    Posts
    3,299
    Rep Power
    348

    Re: MCI Video Wrapper

    Thanks Petr for the modifications. Never thought that this include file would deserve its own topic.

  5. #5
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    404

    Re: MCI Video Wrapper

    It does as we learn how to use a video texture with sound too for other effects, like talking big heads on screen in future Big Brother Government type games Always nice to see those kind of screens in movies and games at least for me... very symbolic and mood setting.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  6. #6

    Re: MCI Video Wrapper

    Hi Mike, Petr.

    The "mciVideo.inc" file does not seem compatible with latest preview thinbasic 1.7.0.0 released 08 Nov 2008...

    I get error report:

    Error Code: 4
    Error Description: Equal Sign Expected
    Line Number: 58
    Code: FUNCTION OPENMOVIE (MVHWND AS LONG, MVFILENAME AS STRING) AS LONG

    Token Found: WANTREPEATMOVIE

    This does not happen in TB Stable Release 1.6.0.10

    Regards,
    catventure.
    http://tab.thinbasic.com - Home Of The ThinBasic Adventure Builder Project. (Interactive Fiction/Text Adventure Maker)

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,814
    Rep Power
    10

    Re: MCI Video Wrapper

    catventure,

    here it is working fine with latest thinbasic 1.7.0.0 preview version.
    Example attached. Let me know if it is working on your side.

    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #8

    Re: MCI Video Wrapper

    Hi Eros,

    Yes. That example you posted works OK.
    I will see if I can track down the source of the problem.

    Cheers,
    catventure.
    http://tab.thinbasic.com - Home Of The ThinBasic Adventure Builder Project. (Interactive Fiction/Text Adventure Maker)

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,146
    Rep Power
    735

    Re: MCI Video Wrapper

    Hi Catventure,

    the include file works for me too.
    It must be something before you include it ( maybe ? ).


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  10. #10
    Hi,

    This wrapper is great for use in TAB adventure writing program and allows the writer/creator ro make .wmv video files to show in games.


    On Vista I can play different size vids in my program and youtube vids for instance as long as they converted in .wmv format for the mcivideo.INC commands to work.
    And they are positioned and sized correctly by my below bits of code.

    HOWEVER - For some reason that I can't figure this code is not displaying the video in the box at the correct size or position in the demo I posted on some people's systems!!


    'Plays movie in listview control
    '========================
    '========================
     
     
    IF INSTR( checkact, "playmovie2" ) = 1 AND displaymode = 2 THEN
            Local filename As String
            filename = APP_SourcePath + gfxfolder + Mid$( checkact, 11 )
            IF FILE_EXISTS( filename ) = %FALSE THEN
                MSGBOX hwnd, filename + " does not exist.", %MB_ICONERROR OR %MB_OK, "TAB Warning"
                EXIT FUNCTION
            ELSE
                 
                Local hCanvas As Long
                 
                Control Handle hwnd, %id_listview2 To hCanvas
                 
                Local twidth, theight As Long
     
     
     
     
                Dialog Get Size hcanvas To twidth, theight
                 
                MENU SET STATE hpopup1, BYCMD %ID_OPEN, %MF_DISABLED OR %mf_grayed
                MENU SET STATE hpopup1, BYCMD %ID_NEWGAME, %MF_DISABLED OR %mf_grayed
                MENU SET STATE hpopup1, BYCMD %ID_SAVEGAME, %MF_DISABLED OR %mf_grayed
                MENU SET STATE hpopup1, BYCMD %ID_LOADGAME, %MF_DISABLED OR %mf_grayed
                MENU SET STATE hpopup1, BYCMD %transcript, %MF_DISABLED OR %mf_grayed
                MENU Set State hpopup1, ByCMD %transcriptoff,%MF_DISABLED Or %MF_GRAYED 
                MENU Set State hpopup1, ByCMD %id_exitgame, %MF_DISABLED Or %MF_GRAYED
                 
                 
                OpenMovie( hCanvas, filename )
                PlayMovie( )
                PlaceMovie( 0, 0, twidth*2, theight*2 )
                 
                movieon = 1
                Dialog Disable hwnd
                 
                Do
                    Control Set Focus hwnd,%id_richedit4
                    IF GETWINDOWKEYSTATE( hwnd, %vk_escape ) THEN
                        videoescapekey
                        EXIT DO
                    END IF
                    If IsMoviePlaying( ) = %FALSE And movieon > 0 Then
                        videoescapekey
     
     
     
     
                    END IF
                LOOP UNTIL movieon = 0
                EXIT FUNCTION
            END IF
        END IF
        '==========================
    

    ' Tried using label control INSTEAD and also with label control on top of listview control as below
     
     
     
     
    'Plays movie in LABEL control overlaid over listbox control
    '==============================================
    '===============================================
     
     
     
     
        IF INSTR( checkact, "playmovie2" ) = 1 AND displaymode = 2 THEN
            Local filename As String
            filename = APP_SourcePath + gfxfolder + Mid$( checkact, 11 )
            IF FILE_EXISTS( filename ) = %FALSE THEN
                MSGBOX hwnd, filename + " does not exist.", %MB_ICONERROR OR %MB_OK, "TAB Warning"
                EXIT FUNCTION
            ELSE
                 
               Local hCanvas As Long
                 
                 
                Control Handle hwnd, %id_listview2 To hCanvas
                 
                Local twidth, theight, xloc, yloc As Long
                 
                Dialog Get Size hcanvas To twidth, theight
                 
                Dialog Get Loc hcanvas To xloc, yloc
                 
                Control Add Label, hwnd, %ID_textview, "", xloc, yloc, twidth, theight, %SS_BITMAP        
            ' 
                Control Handle hwnd, %id_textview To hCanvas           
                 
                MENU SET STATE hpopup1, BYCMD %ID_OPEN, %MF_DISABLED OR %mf_grayed
                MENU SET STATE hpopup1, BYCMD %ID_NEWGAME, %MF_DISABLED OR %mf_grayed
                MENU SET STATE hpopup1, BYCMD %ID_SAVEGAME, %MF_DISABLED OR %mf_grayed
                MENU SET STATE hpopup1, BYCMD %ID_LOADGAME, %MF_DISABLED OR %mf_grayed
                MENU SET STATE hpopup1, BYCMD %transcript, %MF_DISABLED OR %mf_grayed
                MENU Set State hpopup1, ByCMD %transcriptoff,%MF_DISABLED Or %MF_GRAYED 
                MENU Set State hpopup1, ByCMD %id_exitgame, %MF_DISABLED Or %MF_GRAYED
                 
                 
                OpenMovie( hCanvas, filename )
                PlayMovie( )
                PlaceMovie( 0, 0, twidth*2, theight*2 )
                         
                movieon = 1
                 
                Dialog Disable hwnd
                CONTROL DISABLE hwnd, %id_textbox2
                DO
                    IF GETWINDOWKEYSTATE( hwnd, %vk_escape ) THEN
                        videoescapekey
                        EXIT DO
                    END IF
                    IF IsMoviePlaying( ) = %false AND movieon > 0 THEN
                        closemovie( )
                        movieon = 0
                        dialog enable hwnd
                        MENU SET STATE hpopup1, BYCMD %ID_OPEN, %MF_ENABLED
                        MENU SET STATE hpopup1, BYCMD %ID_NEWGAME, %MF_ENABLED
                        MENU SET STATE hpopup1, BYCMD %ID_SAVEGAME, %MF_ENABLED
                        MENU SET STATE hpopup1, BYCMD %ID_LOADGAME, %MF_ENABLED
                        MENU SET STATE hpopup1, BYCMD %transcript, %MF_ENABLED
                        MENU Set State hpopup1, ByCMD %transcriptoff, %MF_ENABLED
                        MENU Set State hpopup1, ByCMD %id_exitgame, %MF_ENABLED
                        CONTROL KILL hwnd, %id_textview
                        CONTROL ENABLE hwnd, %id_textbox2
                        GETWINDOWKEYSTATE( hwnd, - 1 )
                        CONTROL SET TEXT hwnd, %id_textbox2, ""
                        CONTROL SET FOCUS hwnd, %id_textbox2
                    END IF
                LOOP UNTIL movieon = 0
                EXIT FUNCTION
            END IF
        END IF
        '==========================
    

    Eros, Petr or Michael,


    Can you cast an eye over the code I posted and detect if I did something wrong when calling the video routines for placing and sizing the video?

    Works great on mine (Vista) and vids, small or large or perfectly sized into graphicbox control like in lower box of the image attached:

    vert_display.jpg

    catventure.


    PS. It requires the "winmm.dll" to be present in the users system32 folder! Would the mcivideo.INC still in fact work on windows 7 or 10?


    I wanted my program to work on all windows from XP onwards that why I am still using older version of thinbasic to keep compatibility with XP

    Any help appreciated.
    Last edited by catventure; 20-06-2020 at 14:40.
    http://tab.thinbasic.com - Home Of The ThinBasic Adventure Builder Project. (Interactive Fiction/Text Adventure Maker)

Page 1 of 3 123 LastLast

Similar Threads

  1. Another open source wrapper for FreeBASIC
    By maxim in forum Irrlicht
    Replies: 3
    Last Post: 24-06-2011, 08:03

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •