Recent

Author Topic: to reproduce the whole folder  (Read 66719 times)

Neprofi

  • Full Member
  • ***
  • Posts: 174
to reproduce the whole folder
« on: June 07, 2015, 04:06:34 pm »
how in the project to reproduce the whole folder consisting of sounds???Help please!

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: to reproduce the whole folder
« Reply #1 on: June 07, 2015, 04:17:43 pm »
Code: [Select]
var
  FilesList: TStringList;
  i :Integer;
begin
  FilesList := TStringList.Create;
  try
    FindAllFiles(FilesList, ExtractFilePath(Application.Exename) + '\sound');
    for i := 0 to FilesList.Count - 1 do
      OpenDocument(FilesList[i]);
  finally
    FilesList.Free;
  end;
end;         

Neprofi

  • Full Member
  • ***
  • Posts: 174
next reproduction
« Reply #2 on: June 08, 2015, 09:31:05 pm »
I work with bass library. what code is necessary that at the termination of a track it would pass with the machine gun to the following? for earlier thanks)))

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: next reproduction
« Reply #3 on: June 08, 2015, 09:35:33 pm »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: next reproduction
« Reply #4 on: June 08, 2015, 09:42:01 pm »
Neprofi is expecting the first track to finish before the next one starts.
That's why OpenDocument won't work, since it doesn't wait until the first track finishes.

But you're right, I'm going to merge two topics together.

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: to reproduce the whole folder
« Reply #5 on: June 08, 2015, 09:45:55 pm »
isn't present to me it is necessary here that: the song plays when it ended is reproduced following automatically!

rvk

  • Hero Member
  • *****
  • Posts: 6890
Re: to reproduce the whole folder
« Reply #6 on: June 08, 2015, 09:49:01 pm »
Actually it should have been merged with this question:
http://forum.lazarus.freepascal.org/index.php/topic,28632

I already provided help to Neprofi with playing files after each other in combination with the Bass library:
http://forum.lazarus.freepascal.org/index.php/topic,28632.msg179291.html#msg179291

If he/she already has that code I'm not sure why he/she is asking it again.

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: to reproduce the whole folder
« Reply #7 on: June 08, 2015, 10:02:36 pm »
The question sounds in that: that I through ini will reproduce the file! and this function for some reason doesn't work any more (((at me the list is set in ini the file through it I connect that the sound would play, when pressing on before plays and plays back, and here that the machine gun the song would play the code didn't approach (((

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: to reproduce the whole folder
« Reply #8 on: June 08, 2015, 10:06:22 pm »
can throw a code??
in general the same code only not a lot of functions changed, procedures are cleaned with Listbox! and now the list through ini the file at me)) I think will be ((but уменя everything is impossible in turn the machine gun to reproduce so easier ((((be so kind as help (((

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: to reproduce the whole folder
« Reply #9 on: June 08, 2015, 10:17:14 pm »
Download this new example:

http://sourceforge.net/projects/lazarusfiles/files/Example.zip/download

Code: [Select]
// uses Process;

var
  FilesList: TStringList;
  i :Integer;
begin
  p8.Executable := 'mplayer.exe';
  //p8.ShowWindow := swoHIDE;   // uncomment this to hide console
  FilesList := TStringList.Create;
  try
    FindAllFiles(FilesList, ExtractFilePath(Application.Exename) + '\sound');
    for i := 0 to FilesList.Count - 1 do
      //OpenDocument(FilesList[i]);
      p8.Parameters.Add(FilesList[i]);
    p8.Execute;
  finally
    FilesList.Free;
  end;
end;     

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: to reproduce the whole folder
« Reply #10 on: June 08, 2015, 10:28:17 pm »
and here I don't use stringlist. I from ini of the file read)))

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: to reproduce the whole folder
« Reply #11 on: June 08, 2015, 10:29:22 pm »
It takes the song address from a file ina, and the musical library reproduces the sound which is to that address)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: to reproduce the whole folder
« Reply #12 on: June 08, 2015, 10:37:14 pm »
Neprofi, you really don't understand the way people are trying to help you.

So in the example above, typo, showed you how to play sounds based of the TStringList.
Re-writting the example to play sounds based of TIniFile is considered the very easy task for pascal developers.

Also, according to rvk's posted thread, you already should have the code that actually plays the list of sounds. But it feels like you've problems adapting it.

They're showing you examples of how the stuff can work, without any binding to your specific task.
They do expect you to be able to combine their example with the code you have.
You're trying to make them write examples according to the task you have.

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: to reproduce the whole folder
« Reply #13 on: June 08, 2015, 10:42:18 pm »
it is possible a code I will show and you tell that isn't enough??

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: to reproduce the whole folder
« Reply #14 on: June 08, 2015, 10:46:19 pm »
Due to the nature of your problem (not willing to learn), I won't do that for free, but others could :)

 

TinyPortal © 2005-2018