PDA

View Full Version : Tripex - a D3D Audio Visualization


pike
2004-01-14, 17:49
here it is, the thread where i think we should decide if tripex will ever be integrated in xbmc or made a plugin.

as you may or may not know, i contacted the author of this very nice directx/3d plugin autumn 2003. the 3rd of october he shared the sourcecode with us. there's been no solid development since then as far as i know.

gamestr17 has some pretty solid thoughts on the subject, i leave it up to him to voice them.

_frodo_ explained on irc that as long as it's a plugin, there shouldn't be a problem (or did i misunderstand you there?)

/pike

Gamester17
2004-01-14, 19:07
as i see it there can be three outcomes of this if someone on the xbmp team decides to code this plugin:
1. we get the tripex author/s permission to release the full source code of the plugin = no issues (and the best option?).
2. plugin doesn't contain xdk libs in .vis & non xdk compiled (xdk be put into xbmc loader instead) = closed source is ok.
3. .vis plugin contain xdk code & we cannot release source code = cannot officialy be released, hosted or traced to us.

in conclusion, the only gripe we have with tripex is if we can't release the source code as a .vis may have to use the xdk

Gamester17
2004-02-03, 15:55
k, pike got reply from tripex author and he's ok to publicly release it's source under glp if he can just remove one thing first...

Gamester17
2004-02-25, 18:25
@pike, any updates from the tripex author? if they are handed to us in time maybe a nice dev on the team could voleenter to port them to xbox xbmc .vis and enter the competition on behalf of tripex's author (not taking credit themself as we could't join)?

pike
2004-02-25, 22:30
i got this before the weekend. he seems to be hard at work :)

might be fun to enter the
viz contest, i guess - it's something to aim for... i'll try and get just
the basic effects in, and if it works ok i'll have a go at putting onscreen
config in. i think it would be a good idea for me to only ever think about
it as writing a windows app, but tryinig to keep all the xbox/pc differences
as separate as contained as possible. that way, i could keep working on the
portable part of it while someone else can write the xbox-specific bits -
though hopefully there won't be many. seeing as i work for a company that
writes games for the xbox (even though i don't have anything to do with the
xbox side of it myself), i don't want to get into any trouble - i expect
there is a pretty strict non-disclosure agreement with microsoft and i doubt
they're particularly fond of you lot... :)

cheers,
ben

pike
2004-03-04, 01:17
yeah, another weekend has slipped past... :) didn't manage to get that much
done - had to go into work both days, but i really don't think it's far off.
it's probably best i give you something to try as soon as i can, at least
then we'll know what needs working on. this weekend... honestly!

cheers,
ben

Gamester17
2004-03-04, 13:52
k,note that there only 9 days left this the contest officialy ends (but this might have to be extended since the x3 chips aren't ready yet)

pike
2004-03-09, 12:31
ok, so i didn't finish it this weekend. you're not surprised, are you? :)

it does, however, run independently of winamp, use the xbmc api, react to sound properly-ish and have few (if any) windows dependencies -i've just broke a few things along the way... i think it'd be a good idea to try getting it to run on an xbox. do you fancy meeting on irc/messenger/icq/something in the next few days, and spending a while swapping code and compiler errors trying to get it to run? i can't think of any major hurdles, but it's probably best to address the problems sooner rather than later...

all the best,
ben

Butcher
2004-03-09, 15:29
i can lend a hand if he needs some help with xbox graphics stuff.

pike
2004-03-09, 15:38
if he chooses irc i will invite hinm to our channel, if there are no objections?

Gamester17
2004-03-09, 16:48
if he chooses irc i will invite hinm to our channel, if there are no objections?
i have no problems with you inviting tripex to the private irc channel, does anyone else? great if you can help him out butcher http://www.xboxmediaplayer.de/forums/non-cgi/emoticons/cool.gif

pike
2004-04-05, 18:52
ben (tha author) is currently moving (alot of that going on lately http://www.xboxmediaplayer.de/forums/non-cgi/emoticons/tounge.gif ) he hope to be back later this week with a broadband connection (he's currently on a modem).

butcher is a little busy atm, apparantly the game he's working on is hitting alpha this month.

Gamester17
2004-04-06, 12:42
butcher is a little busy atm, apparantly the game he's working on is hitting alpha this month.
ok, hope someone else on the team can help ben finnish the code?, at least to be beta in cvs in time for the vis contest (hint,hint,winkwink)

forza
2004-04-06, 15:09
as long as he doesn't need any mega directx stuff and i can help him out if butcher is busy.

pike
2004-04-06, 16:47
forza, the cleaned up code is on .it and doesnt crash xbmc (afaik). but when i played around with it it never outputted anything to xbmc (but launched correctly). there was also some changes made to these 2 files:

cores/dllloader/directx8.h (append @ end)
exp2dll* _xbox_dx8_exp1 = new exp2dll("xbox-dx8.dll", "_d3dxcreatetexture@32", (unsigned long)&d3dxcreatetexture);
exp2dll* _xbox_dx8_exp2 = new exp2dll("xbox-dx8.dll", "_d3dxcreatetexturefromfileinmemory@16", (unsigned long)&d3dxcreatetexturefromfileinmemory);


cores/dllloader/msvcr71.h (append @ end)

#ifndef global_scope
exp2dll* msvcr711 = new exp2dll("msvcr71.dll", "_purecall", (unsigned long)_purecall);
exp2dll* msvcr712 = new exp2dll("msvcr71.dll", "isalnum", (unsigned long)isalnum);
exp2dll* msvcr713 = new exp2dll("msvcr71.dll", "isspace", (unsigned long)isspace);
#else
extern "c" void isalnum( void );
extern "c" void isspace( void );
#endif

and b4 we had to give up he made some changes to the vis files (to try and get more info as to why it didnt work, i later discovered these changes broke other visez aswell)

visualizations/visualisation.cpp
#include "../stdafx.h"
#include "../utils/log.h"
// visualisation.cpp: implementation of the cvisualisation class.
//
//////////////////////////////////////////////////////////////////////

#include "visualisation.h"
#include "graphiccontext.h"
//////////////////////////////////////////////////////////////////////
// construction/destruction
//////////////////////////////////////////////////////////////////////

cvisualisation::cvisualisation(struct visualisation* pvisz,dllloader* ploader, const cstdstring& strvisualisationname)
:m_ploader(ploader)
,m_pvisz(pvisz)
,m_strvisualisationname(strvisualisationname)
{
}

cvisualisation::~cvisualisation()
{
}

void cvisualisation::create()
{
// allow vis. to create internal things needed
// pass it the screen width,height
// and the name of the visualisation.
int iwidth = g_graphicscontext.getwidth();
int iheight= g_graphicscontext.getheight();
char sztmp[129];
sprintf(sztmp,"create:%ix%i %s\n", iwidth,iheight,m_strvisualisationname.c_str());
clog::log(sztmp);
outputdebugstring(sztmp);
m_pvisz->create (g_graphicscontext.get3ddevice(),iwidth,iheight , m_strvisualisationname.c_str());
clog::log("vis: returned\n");
}

void cvisualisation::start(int ichannels, int isamplespersec, int ibitspersample, const cstdstring strsongname)
{
// notify visz. that new song has been started
// pass it the nr of audio channels, sample rate, bits/sample and offcourse the songname
clog::log("vis:start()");
m_pvisz->start(ichannels, isamplespersec, ibitspersample,strsongname.c_str());
clog::log("vis:returned\n");
}

void cvisualisation::audiodata(const short* paudiodata, int iaudiodatalength, float *pfreqdata, int ifreqdatalength)
{
// pass audio data to visz.
// audio data: is short audiodata [channel][iaudiodatalength] containing the raw audio data
// iaudiodatalength = length of audiodata array
// pfreqdata = fft-ed audio data
// ifreqdatalength = length of pfreqdata
clog::log("vis:audiodata\n");
m_pvisz->audiodata(const_cast<short*>(paudiodata), iaudiodatalength, pfreqdata, ifreqdatalength);
clog::log("vis:returned\n");
}

void cvisualisation::render()
{
// ask visz. to render itself
clog::log("vis:render\n");
m_pvisz->render();
clog::log("vis:returned\n");
}

void cvisualisation::stop()
{
// ask visz. to cleanup
clog::log("vis:stop( )\n");
m_pvisz->stop();
clog::log("vis:returned\n");
}


void cvisualisation::getinfo(vis_info *info)
{
// get info from vis
clog::log("vis:getinfo\n");
m_pvisz->getinfo(info);
clog::log("vis:returned\n");


visualizations/visualisationfactory.cpp
#include "../stdafx.h"
#include "visualisationfactory.h"
#include "../cores/dllloader/dll.h"
#include "../util.h"
#include "../utils/log.h"

cvisualisationfactory::cvisualisationfactory()
{
}
cvisualisationfactory::~cvisualisationfactory()
{
}
extern "c" void cdecl* pgetmodule)(struct visualisation*);
struct visualisation* pvisz = (struct visualisation*)malloc(sizeof(struct visualisation));
void* pproc;
pdll->resolveexport("get_module", &pproc);
if (!pproc)
{
clog::log( "vis: couldn't resolve export\n");
// get_module() not found in visualition
delete pdll;
return null;
}
clog::log( "vis: calling getmodule( )\n");

// call get_module() to get the visualisation struct from the visualisation
pgetmodule=(void (__cdecl*)(struct visualisation*))pproc;
pgetmodule(pvisz);

clog::log( "vis: creating visualisation\n");

// and pass it to a new instance of cvisualisation() which will hanle the visualisation
return new cvisualisation(pvisz,pdll, strname);
}


hope this helps http://www.xboxmediaplayer.de/forums/non-cgi/emoticons/cool.gif

Gamester17
2004-04-06, 17:02
also see if should/can implement this bug fix (link) (http://www.xboxmediaplayer.de/cgi-bin/forums/ikonboard.pl?act=st;f=5;t=2932) which then also needs to be taken into consideration and all vis have to be recompiled

Gamester17
2004-04-20, 16:55
fyi, i added ben to the vis contest winners for his code http://www.xboxmediacenter.com/temp/tripex_19-04-2004src.zip

@pike, can you please get me ben's shipping address for when we have received the x3 so we can send him one as a prize?

pike
2004-04-23, 00:59
last i heard he was gonna move house. since then he's mia, send him a cpl of mails but so far no replies. but when he surfaces again i'll fix his adress.

Gamester17
2005-01-05, 18:38
:bump: noone wanting to finish this code and put in cvs?, if not shall we most this thread into the public forum and ask for assistance?

Gamester17
2005-03-02, 17:38
moving this request to finish the tripex visualization to the public forum since got no volenteers from the devs on team-xbmc. any unofficial who can sort this out?, please go right ahead

pike
2005-03-02, 19:00
i added the last touched (but non working on xbox) sources to our cvs repository, /docs/_tripex.zip :saint: