AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi Videos mit dem Form Animate1.ResName
Thema durchsuchen
Ansicht
Themen-Optionen

Videos mit dem Form Animate1.ResName

Ein Thema von taktaky · begonnen am 6. Okt 2007 · letzter Beitrag vom 7. Okt 2007
Antwort Antwort
Seite 1 von 2  1 2      
taktaky
(Gast)

n/a Beiträge
 
#1

Videos mit dem Form Animate1.ResName

  Alt 6. Okt 2007, 22:36
Hallo,

kann man den Film steuern, wenn er in diesem Form ist :
Delphi-Quellcode:
implementation

{$R *.dfm}
{$R videos.res}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Animate1.ResName:='test2';
  Animate1.ResHandle:=hinstance;
  Animate1.Active:=true;
end;
Ich möchte Buttons wie Stopp, Pause zu Verfügung machen

Das Problem, wenn ich die Buttons von MediaPlayer1 dazu einfüge, dann werden nicht aktiv !
Der Film läuft aber.

<>
Miniaturansicht angehängter Grafiken
video-binden-animate1.resname-plus-mediaplayer1_998.jpg  
  Mit Zitat antworten Zitat
6. Okt 2007, 22:39
Dieses Thema wurde von "Matze" von "VCL / WinForms / Controls" nach "Multimedia" verschoben.
taktaky
(Gast)

n/a Beiträge
 
#3

Re: Videos mit dem Form Animate1.ResName

  Alt 6. Okt 2007, 22:57
WinSpay konnte mir leider nicht helfen mit seinem Vorschalg
Delphi-Quellcode:
...
const APPCOMMAND_MEDIA_NEXTTRACK = $B0000;
  APPCOMMAND_MEDIA_PREVIOUSTRACK = $C0000;
  APPCOMMAND_MEDIA_STOP = $D0000;
  APPCOMMAND_MEDIA_PLAY_PAUSE = $E0000;

implementation

{$R *.dfm}
{$R videos.res}

// das Video in Form1 suchen
procedure TForm1.Button4Click(Sender: TObject);
var
  wnd: HWND;
begin
  wnd := FindWindow('TForm1','Form1');
  wnd := FindWindowEx(wnd, 0, 'TAnimate', nil);
if wnd <> 0 then
  Sendmessage(wnd, WM_APPCOMMAND, 0, APPCOMMAND_MEDIA_PLAY_PAUSE)

  else
  ShowMessage('Nicht gefunden'); // diese Meldung wird nicht angezeigt. d.h. das Video wird gefunden aber kann man nicht steuern!!!

end;
  Mit Zitat antworten Zitat
Gehstock

Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
 
Delphi 2007 Professional
 
#4

Re: Videos mit dem Form Animate1.ResName

  Alt 6. Okt 2007, 23:02
Du musst den Buttons vom Mediaplayer auch erstmal sagen was sie tun sollen
Marcel
  Mit Zitat antworten Zitat
taktaky
(Gast)

n/a Beiträge
 
#5

Re: Videos mit dem Form Animate1.ResName

  Alt 6. Okt 2007, 23:05
Zitat von Gehstock:
Du musst den Buttons vom Mediaplayer auch erstmal sagen was sie tun sollen
Das ist aber vorprogrammiert oder?
Was soll ich ihm zu tun sagen?

<>
  Mit Zitat antworten Zitat
Gehstock

Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
 
Delphi 2007 Professional
 
#6

Re: Videos mit dem Form Animate1.ResName

  Alt 6. Okt 2007, 23:15
Delphi-Quellcode:
procedure TForm1.maplayerClick(Sender: TObject; Button: TMPBtnType; //all what happens while clicking different mediaplayer buttons
  var DoDefault: Boolean);
begin
dodefault := false;
case button of // when you click .......

btnext: // .. "NEXT" button
   begin
         Timer1.Enabled := false;
         ProgressBar1.Position := 0;
         FileListBox1.ItemIndex := fileListBox1.ItemIndex + 1;
         maplayer.EnabledButtons := [btpause,btstop,btPrev,btNext];
         try
            playmp3(true);
         except;
         end;
   end;

btprev: // .. "PREVIOUS" button
   begin
      Timer1.Enabled := false;
      ProgressBar1.Position := 0;
      FileListBox1.ItemIndex := fileListBox1.ItemIndex - 1;
      maplayer.EnabledButtons := [btpause,btstop,btPrev,btNext];
         try
            playmp3(true);
         except
         end;
   end;

btstop: // .. "STOP" button
   begin
   Timer1.Enabled := false;
   ProgressBar1.Position := 0;
      try
         maplayer.Stop;
         maplayer.EnabledButtons := [btPlay,btPrev,btNext];
      except
      end;
   end;

btpause: // .. "PAUSE" button
   begin
      try
         maplayer.EnabledButtons := [btPlay,btstop,btPrev,btNext];
         maplayer.Pause;
         Timer1.Enabled := false;
      except
      end;
   end;

btplay: // .. "PLAY" button
   begin
    maplayer.EnabledButtons := [btpause,btstop,btPrev,btNext];
    if index_komada = FileListBox1.ItemIndex then
      begin
      if ProgressBar1.Position = 0 then
         begin
            try
               playmp3(true);
               index_komada := FileListBox1.ItemIndex;
            except
            end;
         end
      else
      begin
         try
            maplayer.Play;
            Timer1.Enabled := true;
         except;
         end;
      end;
      end
    else
      try
         playmp3(true);
         index_komada := FileListBox1.ItemIndex;
       except
       end;
    end;
   end;

end;

schonmal die Suchfunktion oder die Hilfe benutzt
Marcel
  Mit Zitat antworten Zitat
taktaky
(Gast)

n/a Beiträge
 
#7

Re: Videos mit dem Form Animate1.ResName

  Alt 7. Okt 2007, 00:20
was kommt da:
Delphi-Quellcode:
btnext: ???; // .. "NEXT" button

// wenn einfach so dann geht nicht :
btnext:
begin
...

playmp3(true); // ich habe aber avi und keine mp3
Code:
[Warning] Unit1.pas(7): Unit 'FileCtrl' is specific to a platform
[Error] Unit1.pas(80): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Error] Unit1.pas(86): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Error] Unit1.pas(88): Undeclared identifier: 'playmp3'
[Error] Unit1.pas(93): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Error] Unit1.pas(98): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Error] Unit1.pas(111): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Error] Unit1.pas(119): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Error] Unit1.pas(126): Duplicate case label
[Error] Unit1.pas(128): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Error] Unit1.pas(129): Undeclared identifier: 'index_komada'
[Fatal Error] video.dpr(5): Could not compile used unit 'Unit1.pas'
Miniaturansicht angehängter Grafiken
wmp-buttons-probleme_213.jpg  
  Mit Zitat antworten Zitat
taktaky
(Gast)

n/a Beiträge
 
#8

Re: Videos mit dem Form Animate1.ResName

  Alt 7. Okt 2007, 00:43
Ich habe einen Code gefunden aber Probleme mit Buttons:
Delphi-Quellcode:
procedure TForm1.MediaPlayer1Click(Sender: TObject; Button: TMPBtnType;
                                  var DoDefault: Boolean);

var s : String;
begin
 With MediaPLayer1 do begin
   //Memo1.Lines.Add('Click ' + TranslateButton(Button)+
   // ' DoDefault:'+IntToStr(Ord(DoDefault)));
   case Button of
     btPlay : begin
                  EnabledButtons := [btPause, btStop, btNext, btPrev];
                  fClickButton := btPlay;
                  fLastCommand := btPlay;
                end;
     btStop : begin
                  EnabledButtons := [btPlay, btNext, btPrev];
                  fClickButton := Button;
                  Rewind; // Without Rewind Stop & Pause have the same effect
                end;
     btNext : begin
                  DoDefault := False;
                  NextSong;
                  PlaySong;
                end;
     btPrev : begin
                  DoDefault := False;
                  PreviousSong;
                  PlaySong;
                end;
     btPause : begin
                  EnabledButtons := [btPause, btStop, btNext, btPrev];
                  fClickButton := btPlay;
                end;
   end;
   Notify := True;
 End;

end;
Quelle

Code:

[delphi]
[Warning] Unit1.pas(7): Unit 'FileCtrl' is specific to a platform
[Error] Unit1.pas(82): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Error] Unit1.pas(83): Undeclared identifier: 'fClickButton'
[Error] Unit1.pas(84): Undeclared identifier: 'fLastCommand'
[Error] Unit1.pas(87): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Error] Unit1.pas(91): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Error] Unit1.pas(93): Undeclared identifier: 'NextSong'
[Error] Unit1.pas(94): Undeclared identifier: 'PlaySong'
[Error] Unit1.pas(96): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Error] Unit1.pas(98): Undeclared identifier: 'PreviousSong'
[Error] Unit1.pas(102): Incompatible types: 'TMPBtnType' and 'TUDBtnType'
[Fatal Error] video.dpr(5): Could not compile used unit 'Unit1.pas'
Das Problem ist nicht was die Buttons tun, sondern wie man die Buttons aktiv macht !
MediaPlayer1.EnabledButtons := [btpause,btstop,btPrev,btNext]; // Hilft leider nicht
Miniaturansicht angehängter Grafiken
wmp-buttons-probleme2_123.jpg  
  Mit Zitat antworten Zitat
Gehstock

Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
 
Delphi 2007 Professional
 
#9

Re: Videos mit dem Form Animate1.ResName

  Alt 7. Okt 2007, 08:53
zu verstehen was der Code macht dann hättest du gemerkt das da was fehlt
sollen wir dir das komplette Programm vorkauen

Delphi-Quellcode:
procedure TForm10.MediaPlayer1Click(Sender: TObject; Button: TMPBtnType;
  var DoDefault: Boolean);
var s : String;
begin
With MediaPLayer1 do begin
   case Button of
     btPlay : begin
                  EnabledButtons := [btPause, btStop, btNext, btPrev];
                  Play;
                end;
     btStop : begin
                  EnabledButtons := [btPlay, btNext, btPrev];
                  Stop;
                end;
     btNext : begin
                  DoDefault := False;
                  Next;
                  Play;
                end;
     btPrev : begin
                  DoDefault := False;
                  Previous;
                  Play;
                end;
     btPause : begin
                  EnabledButtons := [btPause, btStop, btNext, btPrev];
                  Pause;
                end;
   end;
end;
end;
die Buttons werden nur Enabled wenn du eine datei zugewiesen hast

mit MediaPLayer1.FileName := 'test.wav';
Marcel
  Mit Zitat antworten Zitat
taktaky
(Gast)

n/a Beiträge
 
#10

Re: Videos mit dem Form Animate1.ResName

  Alt 7. Okt 2007, 12:20
Hallo,

Du hast bestimmt das Bild von meinem letzten Problem nicht angeschaut

Das Problem: Die Buttons bleiben deaktiviert:
http://www.delphipraxis.net/download.php?id=29304

Oder nur wenn das Video in einem anderen Form eingebaut wird?
Miniaturansicht angehängter Grafiken
wmp-buttons-einige-deaktiviert_110.jpg  
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2      


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:08 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz