Autor Beitrag
Ironhead
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

Win XP,Kanotix 5

BeitragVerfasst: Fr 02.03.07 19:05 
Hab da mal ein Problemchen(wie sollte es auch anders sein) :lol:

Ich möchte mit Bass.dll eine Playlist machen, also ich ziehe mir per Drag und Drop mehrere mp3 Files in eine Listbox, und auf den Klick auf einen eintrag spielt er ein Lied ab. Das klappt auch ganz gut soweit, nur beim klick auf einen nächsten eintrag hört er mit dem davor nicht auf, sondern spielt dann 3,4,5 oder 6 Titel gleichzeitig.

Dies steht in meiner ONClick der Listbox:
ausblenden Delphi-Quelltext
1:
2:
3:
  w := ListBox1.ItemIndex;
  i := BASS_StreamCreateFile(False, PChar(ListBox1.Items.Strings[w]), 0, 0, 0);
  BASS_ChannelPlay(i , False);


kann mir vielleicht einer auf die sprünge helfen :?: :roll:
Schamese
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17

Windows 2008 Server
Delphi 5 Ent., C# (Visual Studio 2008)
BeitragVerfasst: Fr 02.03.07 19:37 
Ich nehme an, du hast eine globale channel-variable.
Die musst du vorher Stoppen.
ausblenden Delphi-Quelltext
1:
   BASS_ChannelStop(channelvariable);					

dann kannst du einfach den channel wieder neu starten
ausblenden Delphi-Quelltext
1:
2:
3:
4:
 
  w := ListBox1.ItemIndex;
  i := BASS_StreamCreateFile(False, PChar(ListBox1.Items.Strings[w]), 0, 0, 0);
  BASS_ChannelPlay(i , False);


Gruß, Christian.
Ironhead Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

Win XP,Kanotix 5

BeitragVerfasst: Fr 02.03.07 20:32 
ja Danke, hab es jetz so gemacht und es funzt, hab mir es schwieriger vorgestellt, hätt ich auch gleich drauf kommen können.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  Bass_Free;
  BASS_Init(-1, 44100, 0, Application.Handle, nil);
  w := ListBox1.ItemIndex;
  i := BASS_StreamCreateFile(False, PChar(ListBox1.Items.Strings[w]), 0, 0, 0);
  BASS_ChannelPlay(i , False);


Dank dir
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 02.03.07 20:36 
Stop doch einfach den Stream, anstatt die ganze Bass-Engine freizugeben und neu zu initialisieren. Wie das geht, hat user profile iconSchamese ja schon geschrieben.

_________________
We are, we were and will not be.
Gandalfus
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 129



BeitragVerfasst: Do 08.03.07 18:33 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
 
  if BASS_ChannelIsActive(channel)=1 then
  begin   
    BASS_StreamFree(channel);
  end;

_________________
Wennn man feststellt, dass es drei Moeglichkeiten gibt, die einen Vorgang schiefgehen lassen koennen und man diese ausschaltet, entstehen automatisch drei neue Moeglichkeiten.