librelist archives

« back to archive

decision driven fairy tale - issues

decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-01-23 @ 14:34
Hi,

I'm working on a decision driven fairy tale for my kids and I've
encountered some issues.

I am using the URL system to simulate different pages. The code is here:
https://github.com/sebastjan-hribar/princ

And here my questions:

1. Am I right when using class variable (lines 13 and 56) or is this
some sort of violation of ruby rules? I've tried instance variable and
it didn't work.

2. I am setting the background color but when I scroll down the app, the
background color is limited to the initial frame. Is there a way to set
it so the background color flows as I scroll?

3. What is the correct way to pass a click block to an image (line 56)?
The idea is to make this semi interactive so one can click on an image
and the item gets added to a backpack and so forth.
I've tried everything and I can't get it right...

4. This isn't an issue, more a question: is it possible to embed audio
files in a similar way as videos? If that were possible I'd include
audio because for example my daughter can't read yet, but she can click
fine:)


I apologize because the text is Slovene, but I hope the issues will be
understandable.

kind regards
seba

PS: Any other suggestion for refactoring are most welcome:)

Re: [shoes] decision driven fairy tale - issues

From:
J. Kaiden
Date:
2013-01-24 @ 01:29
hi Sebastjan -

  this game looks cool!  i'm sure your kids will love it...

  as for question 2, about the background color - i haven't had a lot of
time, but i've confirmed the same issue on my setup (ubuntu 12.04, ruby
1.9.3) and i can't believe i never noticed this before...  i'll keep
fooling around, and let you know if i find anything out.

  as for 3, the image click - i don't know what the best way is, but your
way seems just fine...  you could also do something like this:

img = image("TradyBlix.png").click{ask_open_file}

  ...but i don't know if that's any better or worse ;)

  as for 4 - audio...  there may well be an easier way (@ashbb, any ideas?)
but if you're using green shoes, you've got gtk, and that means you can use
gstreamer - you can install the gem, and then require 'gst' in your code.
 check it out here: http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gst

  ...unfortunately the tutorial is outdated, the documentation is kind of
sketchy, and it's way more complicated than good old shoes (isn't shoes
awesome?) - but the nuts and bolts of playing a file are something like
this:

require 'green_shoes'
require 'gst'

Shoes.app do
pipeline = Gst::ElementFactory.make("playbin2")
pipeline.uri = GLib.filename_to_uri("/absolute/path/to/file.mp3")

pipeline.play
end

   ...the nice thing about green shoes is that it takes care of the
gtk/gstreamer main loop for you.  the "playbin2" element will play most any
audio file, and the pipeline has methods you'd expect like :play, :stop,
and :pause.

good luck and Shoes On!

 - j


On Wed, Jan 23, 2013 at 3:34 PM, Sebastjan Hribar <
sebastjan.hribar@gmail.com> wrote:

> Hi,
>
> I'm working on a decision driven fairy tale for my kids and I've
> encountered some issues.
>
> I am using the URL system to simulate different pages. The code is here:
> https://github.com/sebastjan-hribar/princ
>
> And here my questions:
>
> 1. Am I right when using class variable (lines 13 and 56) or is this
> some sort of violation of ruby rules? I've tried instance variable and
> it didn't work.
>
> 2. I am setting the background color but when I scroll down the app, the
> background color is limited to the initial frame. Is there a way to set
> it so the background color flows as I scroll?
>
> 3. What is the correct way to pass a click block to an image (line 56)?
> The idea is to make this semi interactive so one can click on an image
> and the item gets added to a backpack and so forth.
> I've tried everything and I can't get it right...
>
> 4. This isn't an issue, more a question: is it possible to embed audio
> files in a similar way as videos? If that were possible I'd include
> audio because for example my daughter can't read yet, but she can click
> fine:)
>
>
> I apologize because the text is Slovene, but I hope the issues will be
> understandable.
>
> kind regards
> seba
>
> PS: Any other suggestion for refactoring are most welcome:)
>
>

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-01-24 @ 06:50
Hi Jake,


>   this game looks cool!  i'm sure your kids will love it...

thx:)
> 

>   as for 3, the image click - i don't know what the best way is, but
> your way seems just fine...  you could also do something like this:

I was asking for the correct way, because my code for this always causes
errors. I modified your snippet to:

        img = image("images/jabolko.png").click do 
        @@nahrbtnik << "jabolko"
        para @@nahrbtnik
        end

and now it works (the para @@nahrbtnik is just a test to see it gets
added)
Still, if someone knows another way of passing a click block to an
image, please let me know.


>   ...unfortunately the tutorial is outdated, the documentation is kind
> of sketchy, and it's way more complicated than good old shoes (isn't
> shoes awesome?) - but the nuts and bolts of playing a file are
> something like this:
> 
Thx!!! You're giving me gold here:))))
And for the record, I don't think one can say too many times "shoes is
awesome!" :)))

Your code below works fine, there was just one thing missing: Gst has to
be initialized:
> 
> 
> require 'green_shoes'
> require 'gst'
> 
> 
> Shoes.app do

Gst.init

> pipeline = Gst::ElementFactory.make("playbin2")
> pipeline.uri = GLib.filename_to_uri("/absolute/path/to/file.mp3")
> 
> 
> pipeline.play
> end
> 

love shoes!
seba
> 

>         
> 
> 

Re: [shoes] decision driven fairy tale - issues

From:
J. Kaiden
Date:
2013-01-24 @ 09:37
hey Seba -

  glad to hear that gstreamer is working for you - sorry i forgot to
mention the 'Gst.init' bit - on my set up i didn't actually need it to play
a file while running under green shoes.

  hope the game comes along well - it'll be cool to see it when it's
finished...

  - j


On Thu, Jan 24, 2013 at 7:50 AM, Sebastjan Hribar <
sebastjan.hribar@gmail.com> wrote:

> Hi Jake,
>
>
> >   this game looks cool!  i'm sure your kids will love it...
>
> thx:)
> >
>
> >   as for 3, the image click - i don't know what the best way is, but
> > your way seems just fine...  you could also do something like this:
>
> I was asking for the correct way, because my code for this always causes
> errors. I modified your snippet to:
>
>         img = image("images/jabolko.png").click do
>         @@nahrbtnik << "jabolko"
>         para @@nahrbtnik
>         end
>
> and now it works (the para @@nahrbtnik is just a test to see it gets
> added)
> Still, if someone knows another way of passing a click block to an
> image, please let me know.
>
>
> >   ...unfortunately the tutorial is outdated, the documentation is kind
> > of sketchy, and it's way more complicated than good old shoes (isn't
> > shoes awesome?) - but the nuts and bolts of playing a file are
> > something like this:
> >
> Thx!!! You're giving me gold here:))))
> And for the record, I don't think one can say too many times "shoes is
> awesome!" :)))
>
> Your code below works fine, there was just one thing missing: Gst has to
> be initialized:
> >
> >
> > require 'green_shoes'
> > require 'gst'
> >
> >
> > Shoes.app do
>
> Gst.init
>
> > pipeline = Gst::ElementFactory.make("playbin2")
> > pipeline.uri = GLib.filename_to_uri("/absolute/path/to/file.mp3")
> >
> >
> > pipeline.play
> > end
> >
>
> love shoes!
> seba
> >
>
> >
> >
> >
>
>
>

Re: [shoes] decision driven fairy tale - issues

From:
ashbb
Date:
2013-01-24 @ 11:43
Hi Seba, J and folks,

Fantastic game!! :-D

> 1. Am I right when using class variable (lines 13 and 56) or is this
> some sort of violation of ruby rules? I've tried instance variable and
> it didn't work.
Using class variable is okay. But click option requires proc object.
So, try to the following.

click => proc{@@nahrbtnik << "jabolko"}

> 2. I am setting the background color but when I scroll down the app, the
> background color is limited to the initial frame. Is there a way to set
> it so the background color flows as I scroll?
Try to add one more flow block like this:

  def prvo
    flow do
      background antiquewhite
        stack margin: 20 do
          para
          image
            :
        end
      end
    end
  end

> 3. What is the correct way to pass a click block to an image (line 56)?
> The idea is to make this semi interactive so one can click on an image
> and the item gets added to a backpack and so forth.
> I've tried everything and I can't get it right...
Look at above #1 answer.

> 4. This isn't an issue, more a question: is it possible to embed audio
> files in a similar way as videos? If that were possible I'd include
> audio because for example my daughter can't read yet, but she can click
> fine:)
Look at this: http://ashbb.github.com/green_shoes/Video.html
Use `video` method. The [green_shoes/samples/sample58.
rb]() will help you.
Note: MP3 is not available for now (licence issue). Ogg Vorbis is nice.

Cheers,
ashbb

Re: [shoes] decision driven fairy tale - issues

From:
Khristian
Date:
2013-01-24 @ 12:06
Hey everyone,

What are you using to run this app? I tried installing green_shoes
with rubygems, but I always get some sort of error, either from the
code (which I then tried to fix), or from green_shoes' dependencies
(like not finding gtk, even though it was just installed).

I tried it in a cygwin environment.

Thanks!

On Thu, Jan 24, 2013 at 12:43 PM, ashbb <ashbbb@gmail.com> wrote:
> Hi Seba, J and folks,
>
> Fantastic game!! :-D
>
>
>> 1. Am I right when using class variable (lines 13 and 56) or is this
>> some sort of violation of ruby rules? I've tried instance variable and
>> it didn't work.
> Using class variable is okay. But click option requires proc object.
> So, try to the following.
>
> click => proc{@@nahrbtnik << "jabolko"}
>
>
>> 2. I am setting the background color but when I scroll down the app, the
>> background color is limited to the initial frame. Is there a way to set
>> it so the background color flows as I scroll?
> Try to add one more flow block like this:
>
>   def prvo
>     flow do
>       background antiquewhite
>         stack margin: 20 do
>           para
>           image
>             :
>         end
>       end
>     end
>   end
>
>
>> 3. What is the correct way to pass a click block to an image (line 56)?
>> The idea is to make this semi interactive so one can click on an image
>> and the item gets added to a backpack and so forth.
>> I've tried everything and I can't get it right...
> Look at above #1 answer.
>
>
>> 4. This isn't an issue, more a question: is it possible to embed audio
>> files in a similar way as videos? If that were possible I'd include
>> audio because for example my daughter can't read yet, but she can click
>> fine:)
> Look at this: http://ashbb.github.com/green_shoes/Video.html
> Use `video` method. The [green_shoes/samples/sample58.
> rb]() will help you.
> Note: MP3 is not available for now (licence issue). Ogg Vorbis is nice.
>
> Cheers,
> ashbb
>



-- 
Khristian Alexander Schönrock
http://derkosak.blogspot.com - Meu blógue!

Re: [shoes] decision driven fairy tale - issues

From:
ashbb
Date:
2013-01-25 @ 11:52
Hi Khristian,

> I tried installing green_shoes
> with rubygems, but I always get some sort of error, either from the
> code (which I then tried to fix), or from green_shoes' dependencies
> (like not finding gtk, even though it was just installed).
Thanks for trying to install green_shoes. :)
I'd like to make sure that
- when do you get the error?
- gem install problem? (i.e. you can't install green_shoes?)
- or run-an-app-with-green_shoes problem?

ashbb

Re: [shoes] decision driven fairy tale - issues

From:
Khristian
Date:
2013-01-25 @ 12:21
Hello ashbb,

The error I found were of the run-an-app-with-green_shoes kind. I'll
retrace my steps later, I don't have my environment right now.

Should I get the gem via rubygems, or should I try building it from source?

On Fri, Jan 25, 2013 at 12:52 PM, ashbb <ashbbb@gmail.com> wrote:
> Hi Khristian,
>
>
>> I tried installing green_shoes
>> with rubygems, but I always get some sort of error, either from the
>> code (which I then tried to fix), or from green_shoes' dependencies
>> (like not finding gtk, even though it was just installed).
> Thanks for trying to install green_shoes. :)
> I'd like to make sure that
> - when do you get the error?
> - gem install problem? (i.e. you can't install green_shoes?)
> - or run-an-app-with-green_shoes problem?
>
> ashbb



-- 
Khristian Alexander Schönrock
http://derkosak.blogspot.com - Meu blógue!

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-01-27 @ 16:20
hi,

I've come a little further with this project:) yet something bugs me...

1. In line 159
(https://github.com/sebastjan-hribar/princ/blob/master/princ.rb)

I try to fork the game by checking the backapck via regex, but somehow
it doesn't work.

Oh, I translated the code to English, so only the gameplay text is in
Slovene:)

2. The bacground graphics is messed up again. Don't know why, but I'll
deal with that at the end I guess.


love shoes!
seba

Re: [shoes] decision driven fairy tale - issues

From:
Arne Brasseur
Date:
2013-01-27 @ 16:53
Hi Seba,

Nice work!

You'll have to phrase that line 159 a little different.

@@backpack.include? /torch/

will check if @@backpack contains the Regexp /torch/.

['image/torch.png'].include? /torch/      # => false
[/torch/].include? /torch/                     # => true

What I think you want to achieve is

@@backpack.any? {|item| item =~ /torch/}

Shoes on!

Arne

On Sun, Jan 27, 2013 at 5:20 PM, Sebastjan Hribar
<sebastjan.hribar@gmail.com> wrote:
> hi,
>
> I've come a little further with this project:) yet something bugs me...
>
> 1. In line 159
> (https://github.com/sebastjan-hribar/princ/blob/master/princ.rb)
>
> I try to fork the game by checking the backapck via regex, but somehow
> it doesn't work.
>
> Oh, I translated the code to English, so only the gameplay text is in
> Slovene:)
>
> 2. The bacground graphics is messed up again. Don't know why, but I'll
> deal with that at the end I guess.
>
>
> love shoes!
> seba
>

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-01-28 @ 13:48
I removed all images from github because I've just realized I may
violate some copyrights. I've pulled them from various sites using net
search.

This fairy-tale/game would for my own use of course, but still I am not
sure whether I can use them. Any advice? I mean if other people would
like to use this app they can (I may translate the whole thing to
English), but would that be a violation of some copyright if other
people use this app and these images are included?

I am thinking of drawing my own images, but that will take so much
time:)

regards,
seba  

Re: [shoes] decision driven fairy tale - issues

From:
Arne Brasseur
Date:
2013-01-28 @ 15:16
Hey Seba,

You could try to find images that are "public domain" or "creative
commons". In the first case there's no copyrights attached, in the
second it's like free software/open source, the person with the
copyright explicitly gives you permission to use them. With Creative
Commons there are several types, you might need to credit the author
for example.

These are two good places to try

http://archive.org/
http://search.creativecommons.org/

Arne

On 28 January 2013 14:48, Sebastjan Hribar <sebastjan.hribar@gmail.com> wrote:
> I removed all images from github because I've just realized I may
> violate some copyrights. I've pulled them from various sites using net
> search.
>
> This fairy-tale/game would for my own use of course, but still I am not
> sure whether I can use them. Any advice? I mean if other people would
> like to use this app they can (I may translate the whole thing to
> English), but would that be a violation of some copyright if other
> people use this app and these images are included?
>
> I am thinking of drawing my own images, but that will take so much
> time:)
>
> regards,
> seba
>

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-01-28 @ 18:11
Dne 28.01.2013 (pon) ob 16:16 +0100 je Arne Brasseur napisal(a):
> Hey Seba,
> 
> You could try to find images that are "public domain" or "creative
> commons". In the first case there's no copyrights attached, in the
> second it's like free software/open source, the person with the
> copyright explicitly gives you permission to use them. With Creative
> Commons there are several types, you might need to credit the author
> for example.
> 
> These are two good places to try
> 
> http://archive.org/
> http://search.creativecommons.org/
> 
> Arne

Hi Arne,

thank you for your help and the suggested sites.

regards
seba

Re: [shoes] decision driven fairy tale - issues

From:
David Eastman
Date:
2013-01-28 @ 15:11
No one in their right mind will give you legal advice!

Check back with where you found the images and see if they had obvious
restrictions attached to them. But in general this is an attitude problem.
If this is clearly a personal / educational and is distributed as such, you
are unlikely to concern anyone.

Your intention to replace the images should be mentioned in the github
roadmap.


On Mon, Jan 28, 2013 at 1:48 PM, Sebastjan Hribar <
sebastjan.hribar@gmail.com> wrote:

> I removed all images from github because I've just realized I may
> violate some copyrights. I've pulled them from various sites using net
> search.
>
> This fairy-tale/game would for my own use of course, but still I am not
> sure whether I can use them. Any advice? I mean if other people would
> like to use this app they can (I may translate the whole thing to
> English), but would that be a violation of some copyright if other
> people use this app and these images are included?
>
> I am thinking of drawing my own images, but that will take so much
> time:)
>
> regards,
> seba
>
>

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-01-28 @ 18:19
Dne 28.01.2013 (pon) ob 15:11 +0000 je David Eastman napisal(a):
> No one in their right mind will give you legal advice!
> 
I wasn't looking for legal advice, what I had in mind were personal
experiences. My mistake on the poor wording.
> 
> Check back with where you found the images and see if they had obvious
> restrictions attached to them. But in general this is an attitude
> problem. If this is clearly a personal / educational and is
> distributed as such, you are unlikely to concern anyone. 

Thank you, I've started with this in the meantime.
> 
> 
> Your intention to replace the images should be mentioned in the github
> roadmap.

What can I say, I am still learning all different aspects related to
programming and I've started using github only recently so I am still
learning. Thank you for the advice.

kind regards,
seba 
> 
> 

> 
> 

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-01-27 @ 17:51
> What I think you want to achieve is
> 
> @@backpack.any? {|item| item =~ /torch/}

Thank you, I refactored accordingly.
seba

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-01-24 @ 12:35
Dne 24.01.2013 (čet) ob 13:06 +0100 je Khristian napisal(a):
> Hey everyone,
> 
> What are you using to run this app? I tried installing green_shoes
> with rubygems, but I always get some sort of error, either from the
> code (which I then tried to fix), or from green_shoes' dependencies
> (like not finding gtk, even though it was just installed).
> 
> I tried it in a cygwin environment.
> 

Hi Khristian,

I can speak for the code part, that it shouldn't generate any errors
even-though I am still in the middle of the development.
As far as the shoes goes, maybe someone else can help...

love shoes!
seba

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-01-24 @ 12:30
> Using class variable is okay. But click option requires proc object.
> So, try to the following.
> 
> click => proc{@@nahrbtnik << "jabolko"}

thx!!!
> 
> > 2. I am setting the background color but when I scroll down the app,
> the
> > background color is limited to the initial frame. Is there a way to
> set
> > it so the background color flows as I scroll?
> Try to add one more flow block like this:
> 
>   def prvo
>     flow do
>       background antiquewhite
>         stack margin: 20 do
>           para
>           image
>             :
>         end
>       end
>     end
>   end
> 
thx again!!!

> Look at this: http://ashbb.github.com/green_shoes/Video.html
> Use `video` method. The [green_shoes/samples/sample58.
> rb]() will help you.
> Note: MP3 is not available for now (licence issue). Ogg Vorbis is
> nice.

I get this error:

/home/sebastjan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require': cannot load such file -- win32api (LoadError)

> 

Re: [shoes] decision driven fairy tale - issues

From:
ashbb
Date:
2013-01-25 @ 11:53
Hi Seba,

> I get this error:
>
> /home/sebastjan/.rvm/rubies/ruby-1.9.3->
> p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
> `require': cannot load such file -- win32api (LoadError)
Umm,... strange.
What platform are you using?
If you installed ruby by RubyInstaller for Windows, it was installed by
default.
If you are using Linux box, I'm not sure why win32api was required...

ashbb

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-01-25 @ 12:15
> What platform are you using?
> If you installed ruby by RubyInstaller for Windows, it was installed
> by default.
> If you are using Linux box, I'm not sure why win32api was required...

I am using Ubuntu 12.10

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-02-27 @ 05:34
Dne 25.01.2013 (pet) ob 20:53 +0900 je ashbb napisal(a):
> Hi Seba,
> 
> > I get this error:
> >
> > /home/sebastjan/.rvm/rubies/ruby-1.9.3->
> > p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
> > `require': cannot load such file -- win32api (LoadError)
> Umm,... strange.
> What platform are you using?
> If you installed ruby by RubyInstaller for Windows, it was installed
> by default.
> If you are using Linux box, I'm not sure why win32api was required...
> 

Hi,

Is it possible for someone to test the video player on Linux?

I'm using Ubuntu 12.10 and green shoes. I've tried running the sample
code from the green shoes manual
http://ashbb.github.com/green_shoes/Video.html

and playing anything from a youtube video to a local mp3 and I always
get this error:

----------------------------------------------------------------------------------------------------

/home/sebastjan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require': cannot load such file -- win32api (LoadError)

from 
/home/sebastjan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/plugins/video.rb:105:in
`video'
	from video.rb:13:in `block in <main>'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/main.rb:84:in
`instance_eval'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/main.rb:84:in
`app'
	from video.rb:10:in `<main>'


----------------------------------------------------------------------------------------------------



thx
seba

Re: [shoes] decision driven fairy tale - issues

From:
J. Kaiden
Date:
2013-02-27 @ 23:28
hi Seba,

  i get different errors with ubuntu 12.04 - but yeah, it doesn't (and
hasn't) worked.

  if you're running linux and using green shoes, you can easily use
gstreamer for audio (and video, i think...)  you probably already have it
installed under linux, but if not you can install it as a gem.  the basics
of playing an audio file are like this:

require 'green_shoes'
require 'gst'

 Shoes.app do
 pipeline = Gst::ElementFactory.make("playbin2")
  pipeline.uri = GLib.filename_to_uri("/absolute/path/to/file.mp3")
  pipeline.play
 end

good luck - Shoes on!

  - j


On Wed, Feb 27, 2013 at 6:34 AM, Sebastjan Hribar <
sebastjan.hribar@gmail.com> wrote:

> Dne 25.01.2013 (pet) ob 20:53 +0900 je ashbb napisal(a):
> > Hi Seba,
> >
> > > I get this error:
> > >
> > > /home/sebastjan/.rvm/rubies/ruby-1.9.3->
> > > p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
> > > `require': cannot load such file -- win32api (LoadError)
> > Umm,... strange.
> > What platform are you using?
> > If you installed ruby by RubyInstaller for Windows, it was installed
> > by default.
> > If you are using Linux box, I'm not sure why win32api was required...
> >
>
> Hi,
>
> Is it possible for someone to test the video player on Linux?
>
> I'm using Ubuntu 12.10 and green shoes. I've tried running the sample
> code from the green shoes manual
> http://ashbb.github.com/green_shoes/Video.html
>
> and playing anything from a youtube video to a local mp3 and I always
> get this error:
>
> 
----------------------------------------------------------------------------------------------------
> 
/home/sebastjan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
> `require': cannot load such file -- win32api (LoadError)
>
> from
> 
/home/sebastjan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
> `require'
>
> from
> 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/plugins/video.rb:105:in
> `video'
>         from video.rb:13:in `block in <main>'
>
> from
> 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/main.rb:84:in
> `instance_eval'
>
> from
> 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/main.rb:84:in
> `app'
>         from video.rb:10:in `<main>'
>
>
> 
----------------------------------------------------------------------------------------------------
>
>
>
> thx
> seba
>
>
>

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-02-28 @ 06:11


>   i get different errors with ubuntu 12.04 - but yeah, it doesn't (and
> hasn't) worked.
> 
thx, it's good to have this confirmation

I've gone through the lines for which the errors were reported and yes
there is always an reference to win32api, but I suppose there should be
a platform differentiation as ashbb pointed out once before, but I
couldn't find it.  
> 
>   if you're running linux and using green shoes, you can easily use
> gstreamer for audio (and video, i think...)  you probably already have
> it installed under linux, but if not you can install it as a gem.  the
> basics of playing an audio file are like this:
> 
> 
> require 'green_shoes'
> require 'gst'
> 
> 
>  Shoes.app do
> pipeline = Gst::ElementFactory.make("playbin2")
>   pipeline.uri = GLib.filename_to_uri("/absolute/path/to/file.mp3")
>   pipeline.play
>  end
> 
I've already started with gstreamer implementation...

thank you
> 
love shoes!
seba

>         
> 
> 

Re: [shoes] decision driven fairy tale - issues

From:
ashbb
Date:
2013-03-01 @ 12:32
Hi Seba, J and folks,

It may be my fault...
Could you try out the following patch?

D:\green_shoes\lib\plugins>diff video_old.rb video.rb
105c105
<       require 'win32api'
---
>       require 'win32api' if RUBY_PLATFORM =~ /mingw/

Regards,
ashbb

Re: [shoes] decision driven fairy tale - issues

From:
Sebastjan Hribar
Date:
2013-03-01 @ 21:12
> Could you try out the following patch?
> 
> D:\green_shoes\lib\plugins>diff video_old.rb video.rb
> 105c105
> <       require 'win32api'
> ---
> >       require 'win32api' if RUBY_PLATFORM =~ /mingw/
> 

After patching I get the error below when I run the sample code from
green shoes manual. The app opens but no video is displayed. When play
is pressed the app crashes and the error is shown:

-----------------------------------------------

/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/plugins/video.rb:45:in
`play': undefined method `xwindow_id=' for nil:NilClass
	 from video.rb:15:in `block (2 levels) in <main>'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/helper_methods.rb:280:in
`call'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/helper_methods.rb:280:in
`block in mouse_link_control'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/helper_methods.rb:277:in
`each'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/helper_methods.rb:277:in
`mouse_link_control'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/main.rb:53:in
`block in app'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/main.rb:109:in
`call'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/main.rb:109:in
`main'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/main.rb:109:in
`app'
	 from video.rb:10:in `<main>'

/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/ruby.rb:107:in
`exit': wrong number of arguments (1 for 0) (ArgumentError)

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/glib2-1.1.9/lib/glib2.rb:33:in
`exit_application'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/main.rb:109:in
`main'

from 
/home/sebastjan/.rvm/gems/ruby-1.9.3-p194/gems/green_shoes-1.1.365/lib/shoes/main.rb:109:in
`app'
	from video.rb:10:in `<main>'

-------------------------------------------------------------------------------------------------------

regards
seba

Re: [shoes] decision driven fairy tale - issues

From:
ashbb
Date:
2013-03-01 @ 23:57
Hi Seba,

Thanks for taking your time.
Umm,... need to find one more solution for Linux. :-P

Thanks again,
ashbb

unsubscribe

From:
orange thirty
Date:
2013-01-24 @ 16:30
unsubscribe