Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Falstaff

#31
Well, now that you mention it.. yeah I do notice a little frame skip/stutter when the next song gets loaded. I'm not really sure there's much that can be done about it though.. I don't think you can buffer or preload things with PLAYMUSIC.
#32
This is so amazing; I just wish there was an android equivalent :( I was hoping to target both ios and android and no built-in way to access the native input methods sucks .

But anyway, thanks for sharing, this is still awesome!
#33
I actually couldn't access the forum for a couple days there either.. seemed DNS related since the rest of my connection seemed ok. Not sure what was up.. started working again yesterday anyway..
#34
Oh well wasn't really that hard TO deal with, Audacity made converting the files to .ogg a snap. Here is the code I'm using to play music so far in my game, maybe someone else would find it handy. It basically scans the media directory for any .mp3 files and then shuffles them and plays through all of them. On android it searches for .ogg files instead ;)

Just GOSUB LoadSongs to scan for the songs, then GOSUB RunMusic during your main loop to make sure the songs are looping.

Code (glbasic) Select

// --------------------------------- //
// Project: zombietest
// Start: Wednesday, May 09, 2012
// IDE Version: 10.283

GLOBAL CurrentSong%

SUB LoadSongs:

LOCAL audioext$ = ".mp3"
LOCAL files$[]

?IF ANDROID
audioext$ = ".ogg"
?ENDIF

// Grab the number of songs
LOCAL num = MOD(GETFILELIST("*" + audioext$, files$[]), 0x10000)
DIM songs$[num]

// skip 2 because '.' and '..' count
FOR i = 2 TO BOUNDS(files$[], 0) - 1

songs$[i - 2] = files$[i]
DEBUG "Found song: " + songs$[i - 2] + "\n"

NEXT

GOSUB ShuffleSongs

CurrentSong = 0

ENDSUB



SUB ShuffleSongs:

LOCAL num%
LOCAL itemAtIndex$

// Run through each song and shuffle it's order
FOR i = BOUNDS(songs$[], 0) - 1 TO 0 STEP -1

num = RND(i)
SWAP songs$[num], songs$[i]

NEXT

ENDFUNCTION



SUB RunMusic:

IF NOT ISMUSICPLAYING()

INC CurrentSong
IF CurrentSong >= LEN(songs$[]) THEN CurrentSong = 0
PLAYMUSIC songs$[CurrentSong], FALSE

DEBUG "Started playing song: " + songs$[CurrentSong] + "\n"

ENDIF

ENDSUB


#35
At least not through "PLAYMUSIC". Just wondering why? What formats should I use then? I just bought 5 mp3 tracks for my game but I can't get them loaded up under Android.

I searched 'android mp3' and didn't see any info..
#36
Hrm.. bought 5 tracks, and they sound amazing on my windows machine, and iphone.. but indeed no sound on my android tablet :/

wth? How can it be that mp3 doesn't work? Android surely supports playing mp3s itself..?
#37
When do we get to play with it :D
#38
It works! Thanks so much!  :nw:

This is what I ended up with.. a single additional file I called "TestFlightGLBWrapper.mm", under the 'classes' folder, that contains:

Code (glbasic) Select

#import "TestFlight.h"

extern "C" void GLB_Launch_Feedback()
{
    [TestFlight performSelectorOnMainThread:@selector(openFeedbackView) withObject: nil waitUntilDone: YES];
}


and in my GLB project I have a file called "testflight.gbas" which has the following code:

Code (glbasic) Select

?IFDEF IPHONE
IMPORT "C" void GLB_Launch_Feedback()
?ELSE
FUNCTION GLB_Launch_Feedback:
ENDFUNCTION
?ENDIF


Now I can offer a "feedback" button that a beta tester can click on to submit feedback right from their device, and it should show up in testflight's web interface.

Cool :)
#39
Ok, so I was able to get Lion running in a VM, which means I can once again attach a debugger to my iphone :)

It looks like the test flight SDK function is indeed at least being called in my code, but it crashes with an odd error.

Here is the error:

"bool _WebTryThreadLock(bool), 0x393aae0: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now..."

From what google says, it looks like it's a result of a 'background thread' trying to access the 'main thread'.. why would that be the case? I'm guessing it's something to do with how glbasic is rendering or something? I guess Testflight's sdk is trying to open up a web page and this isn't playing well with GLB.. doh.

Any suggestions?
#40
Middle click to close tabs is another part of firefox that works good too..!
#41
Wow this looks awesome, especially if you get a GLB lib going. It's too late for my current project but hopefully it'll be ready in time for the next one :)
#42
Yeah I have over 20 files in my project and definitely end up with lots of tabs open all the time.. I don't know why, but ctrl-f4 doesn't work for me, on either my desktop or laptop. Another way to do it other than right clicking each individual tab would be great.

Also I don't suppose we could change the shortcut from ctrl-f4 to ctrl-w :) I love this shortcut from web browsers, and many of the web development IDE's that I use support it, like Aptana or Dreamweaver. Plus I don't get why ctrl-f4 doesn't work for me.
#43
Right I just meant GLB comes packaged with android-sdk, but I also downloaded and installed it separately to do some other dev with it.. hoping there's no conflicts between GLB's android-sdk and the 'real' one I have installed under c:\android-sdk
#44
Yeah I laughed when I set down to try to see what it would take to get a tester to try out my game on his android phone. I rolled up my sleeves, prepared to lose an entire weekend like when I had to figure out how to get my game on my iphone.

Turns out I just emailed him the .apk, and he just clicked on it.. lol.
#45
Ok this sounds good.. does it matter I downloaded and installed the Android SDK as well? I don't think it should, since I had this problem before I installed the SDK, but yeah I'm hoping there aren't any conflicts from that as well.. but yeah didn't realize it was a jdk 1.7 issue; I'll see about downloading 1.6. Thanks :)