Re: [Gambas-user] Gambas API of ALSA

2010-05-25 Thread Doriano Blengino
Ru Vuott ha scritto:
 Thank you very much.

 Now the problem is how I can use those information with Gambas !!! :-(
   
I would interested too in writing a midi librarian for my keyboard, but 
leaved this idea behind because I am too busy these days. I wrote a 
working one under windows, but now I would need a linux version. So, if 
you succeed in doing something, let me know.

If I well understand, you want to send data to a midi device. It seems 
that you can do it in two ways - using the filesystem, or using the alsa 
library.

In the documentation from:

 I guess you can find some answers here, thanks google!

 https://ccrma.stanford.edu/~craig/articles/linuxmidi/
 
there are several C sources, which can be translated more or less to 
gambas. The simplest of them is:

int main(void) {
   char* device =  /dev/midi ;
   unsigned char data[3] = {0x90, 60, 127};

   // step 1: open the OSS device for writing
   int fd = open(device, O_WRONLY, 0);
   if (fd  0) {
  printf(Error: cannot open %s\n, device);
  exit(1);
   }

   // step 2: write the MIDI information to the OSS device
   write(fd, data, sizeof(data));

   // step 3: (optional) close the OSS device
   close(fd);

   return 0;
}

This code (output/method1.c) does something very simple - it write three 
bytes to the file /dev/midi. You can try from console using something like:
cat myfile /dev/midi
where myfile has a suitable content, like 0x90, 60, 127, which in 
gambas translate to h90, 60, 127.

If you only want to send out some midi data, this approach seems to be 
effective and easy: just open a file for output, and write some bytes to 
it (you must know what to write - this is a different problem). If you 
want to make your device play, you will have to output several 0x90 
0xXX 0xXX (note on event) followed by 0x80 0xXX 0xXX; accurate timing 
will be an issue.

The device /dev/sequencer does similar things, but is more intelligent 
and can do good timing.

Alternatively, you can use a library like alsa. You must use External 
function declaration in gambas, and you will have access to the power 
of alsa. This is not easy, but possible; in this case, you must know a 
little the C language.

To summarize, think at what you want to do and choose one of the three 
methods: /dev/midi is poor and simple; /dev/sequencer is more 
complicated but still easy in gambas; using alsa (OSS is older) is the 
way to go if you want to do a complicated but powerful program.

Let me know if you have more doubts. I have no time to write a program 
myself, but I can find some time to give you some hint. Please specify 
more precisely what you want to do.

Regards,
Doriano

--

___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] smtp mail with gambas 2.20 sent mail body message and/or attached file not sowhon/opened by client

2010-05-25 Thread Benoît Minisini
 Using gambas 2.20.2-1~ppa~karmic1 on Ubuntu 9.10
 
 Below the code i test.
 
 PUBLIC SUB pbinviaposta_Click()
   DIM smtp AS NEW SmtpClient
 
   WITH smtp
 IF NOT IsNull(smtp) THEN
 '  .Alternative = FALSE
   .From = myinternalmailn...@mylocaldomain
   .Subject = My subject
   .Host = 192.168.100.18
   .Port = 25
   .To.Add(myinternalmailn...@mylocaldomain)
 
.Add(Body message never shown  on  client if there is also
 an attachment)
 
   
 .Add(File.Load(/usr/share/doc/texlive-base-bin-doc/dvipdfm/something.pdf
 ), application/pdf, test.pdf)
 
   TRY .Send()
 IF ERROR THEN Message.Error(Send mail failed)
   ENDIF
   END WITH
 END
 
 Testing send message: if i put body and attachement all is sent and
 using a mail client as Thunderbird the attached file is in the mail
 message source but i cannot view it, it seems a malformed multipart
 message the attacched file is not shown or cannot save it to my
 system, Thunderbird give me a message that the attachement is not good
 also tested with Outlook on Win.
 All goes fine if i put only body mail message or attachment, below my test:
 
 A)
 .Add(Body message never shown  on  client if there is also an attachment)
 .Add(File.Load(/usr/share/doc/texlive-base-bin-doc/dvipdfm/something.pdf)
 , application/pdf, test.pdf)
 from client i can see the body message but i got invalid attached file
 
 B)
 .Add(File.Load(/usr/share/doc/texlive-base-bin-doc/dvipdfm/something.pdf)
 , application/pdf, test.pdf)
 .Add(Body message never shown  on  client if there is also an attachment)
 from client i can ope the attached file but i cannot see the mail body
 message
 
 All goes fine if i send C or D:
 
 C)
 .Add(Body message never shown  on  client if there is also an attachment)
 
 D)
 .Add(File.Load(/usr/share/doc/texlive-base-bin-doc/dvipdfm/something.pdf)
 , application/pdf, test.pdf)
 
 
 Thank you
 Marco
 

Can you send me the source of a mail that is malformed? I can't tell you how, 
I don't use Thunderbird. Which may explain why it works fine there.

Regards,

-- 
Benoît Minisini

--

___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] DataSource component - Is it works with postgresql's schemas? - Gambas2

2010-05-25 Thread Benoît Minisini
 I wish to know, if the DataSource component works with postgresql's schema,
 because I try to use it and don't work.
 I modificated DataBase Example, changed in the DataSource2 property, table
 : color = test.color, test is the schema's name and in the other
 DataSource1 I changed Table :test = test.test.
 I get this error = Unknown table test.color
 
 Regards
 
 Jorge Amarilla

Postgresql schemas are supported in Gambas 3 only!

Regards,

-- 
Benoît Minisini

--

___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Feature request

2010-05-25 Thread Benoît Minisini
 I wondered if there was any easy way to find a file (class/form/module) in
 ones code tree. Maybe this feature already exists in gambas3
 
 As I've hundreds of forms, classes and modules, I've got to the point where
 I occasinally 'mislay' one.
 
 Yes I know I can search my HDD easily with locate, but it would be a nice
 feature to be able to type in a name  jump to that subdir with the file.
 
 Regards
 
 Richard

I note that in the TODO file!

-- 
Benoît Minisini

--

___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] [Gambas-devel-svn] SF.net SVN: ga mbas:[2963] gambas/branches/2.0/app/src/gambas2

2010-05-25 Thread Benoît Minisini
 
 Salut Benoît,
 
 got an error now, send you the logs
 

This is a libtool problem apparently. Which version of libtool do you use?

-- 
Benoît Minisini

--

___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] [Gambas-devel-svn] SF.net SVN: gambas:[2963] gambas/branches/2.0/app/src/gambas2

2010-05-25 Thread Charlie Reinl
Am Dienstag, den 25.05.2010, 15:16 +0200 schrieb Benoît Minisini:
  
  Salut Benoît,
  
  got an error now, send you the logs
  
 
 This is a libtool problem apparently. Which version of libtool do you use?
 

[libtool]
ltmain.sh (GNU libtool) 1.5.26 Debian 1.5.26-1ubuntu1 (1.1220.2.493
2008/02/01 16:58:18)


-- 
Amicalement
Charlie

[OperatingSystem]
OperatingSystem=Linux
KernelRelease=2.6.24-27-generic
DistributionVendor=Ubuntu
DistributionRelease=Ubuntu 8.04.4 LTS

[System]
CPUArchitecture=i686
TotalRam=506932 kB

[Gambas]
Gambas1=gbx-1.0.17
Gambas1Path=/usr/bin/gbx

Gambas2=2.20.1Revision:  2771
Gambas2Path=/usr/local/bin/gbx2

Gambas3=2.99.0Revision: 2735 (can't compile actually)
Gambas3Path=/usr/local/bin/gbx3


--

___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] [Gambas-devel-svn] SF.net SVN: gambas:[2963] gambas/branches/2.0/app/src/gambas2

2010-05-25 Thread Benoît Minisini
 Am Dienstag, den 25.05.2010, 15:16 +0200 schrieb Benoît Minisini:
   Salut Benoît,
   
   got an error now, send you the logs
  
  This is a libtool problem apparently. Which version of libtool do you
  use?
 
 [libtool]
 ltmain.sh (GNU libtool) 1.5.26 Debian 1.5.26-1ubuntu1 (1.1220.2.493
 2008/02/01 16:58:18)

Now you have to use libtool 2 to compile Gambas! I didn't find how to make a 
package source that works with both versions. Maybe this is not possible.

Regards,

-- 
Benoît Minisini

--

___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Help with redirecting stdout of the GNU shred command (SHELL/EXEC)

2010-05-25 Thread vikram
Hi,

I am new to
Gambas and this is my first application. I have been working with
C/VC++ and Gambas has been fun so far except for this little problem
i've run into...
 
I am trying to make a GUI front end for the
GNU shred command. I have got to the stage where the user can select a
file via GUI and shred(using SHELL). I am trying to make it more
interactive by reading stdout from shred -v into the Gambas
application. I have followed
http://www.gambasforum.com/index.php?topic=120.0;wap2 and tried to use
EXEC to read stdout, haven't had much luck with it so far :( 



Heres the code:

'global variables

PRIVATE filename AS String   

PRIVATE delfile AS Boolean

PRIVATE shredprocess AS Process

PRIVATE shredcommanddel AS String[3]

PRIVATE shredcommandnodel AS String[3]



'this is where i initialize the command arrays for EXEC

'the last element is replaced later by the filepath

PUBLIC SUB Form_Open()

  'tbx_filename

  shredcommanddel = [shred , -uv ,  ]

  shredcommandnodel = [shred , -v ,  ]

END



'Display a file open dialog and save the path of the file selected to filepath

PUBLIC SUB btn_fileselect_Click()

  IF Dialog.OpenFile() THEN RETURN 

    filename = Dialog.Path 

    tbx_filename.Text = filename

END



'the actual shredding happens here, the code with EXEC is ineffective at the 
moment it doesnt shred the file

'SHELL works, but i dont know how to redirect stdout with either of these

PUBLIC SUB btn_shred_Click()

  'DIM shellcommand AS String[]

  'Message(filename)

  IF delfile THEN 

    'shellcommand = shred --remove --verbose   filename  

    shredcommanddel[2] = filename

    shredprocess = EXEC shredcommanddel 'FOR READ 

  SHELL shred -uv   filename

  ELSE 

    'shellcommand = shred --verbose   filename 

    shredcommandnodel[2] = filename

    shredprocess = EXEC shredcommandnodel 'FOR READ 

    SHELL shred -v   filename

  ENDIF 

  'SHELL shellcommand FOR READ AS Process

  

END

  

'Execution never gets here  

PUBLIC SUB Process_Read()

  DIM resultline AS String

  LINE INPUT #shredprocess, resultline

  Message(HERE WE ARE!)

  resultline = resultline  GB.NewLine

END



PUBLIC SUB CheckBox1_Click()

  delfile = TRUE

END



I am looking for a way to redirect output from the shred to my Gambas 
application.

Appreciate your help in this.

Thanks,
Vikram 




  
--

___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user