1. Post #1841
    voodooattack's Avatar
    October 2009
    1,994 Posts
    Man, I'm loving vala..

      public class HttpSink: Gst.BaseSink
      {
        private static Gst.PadTemplate sink_template;
        private const uint16 default_port = 8080;
        private static Soup.Server? server;
        private Gst.Buffer? preroll_buf;
        private GLib.List<Soup.Message> sessions;
    
        /*
         * Static constructor
         */
    
        static construct
        {
          sink_template = new Gst.PadTemplate (
            "sink",
            Gst.PadDirection.SINK,
            Gst.PadPresence.ALWAYS,
            new Gst.Caps.any ()
          );
        }
        
        /*
         * Class constructor
         */
        
        class construct
        {
          set_details_simple (
            "HTTP Sink",
            "sink",
            "HTTP streaming sink",
            "Abdullah A. Hassan");
    
          add_pad_template (sink_template);
        }
    
        /*
         *  Instance constructor
         */
         
        construct
        {
          port = default_port;
        }
    
        /*
         * Server stuff
         */
    
        [Description (nick = "port", blurb = "Which TCP port to bind.")]
        public uint16 port
        {
          get { return (uint16)server.get_port(); }
          set { setup_server(value); }
        }
    
        private void setup_server(uint16 port = default_port)
        {
          // Should probably set SERVER_ASYNC_CONTEXT too
          server = new Soup.Server(Soup.SERVER_PORT, port);
          server.add_handler(null, serverCallback);
        }
        
        private void serverCallback (Soup.Server server, Soup.Message msg,
          string path, GLib.HashTable<string,string>? query,
            Soup.ClientContext client)
        {
          server.pause_message(msg);
          msg.response_headers.set_encoding(Soup.Encoding.CHUNKED);
          sessions.append(msg);
          msg.finished.connect(() => { sessions.remove(msg); });
    
          if (preroll_buf != null && base.current_state == Gst.State.PLAYING)
          {
            broadcast_buffer(preroll_buf, Soup.MemoryUse.TEMPORARY);
          }
        }
    

    The class modifier makes stuff much more interesting.. a class constructor is executed differently from the static constructor, from what I understand, it gets invoked once for the whole class, but might be invoked again later if all instances of the class are freed.

    A member marked with "class" (as opposed to static) is initialised once, and every new instance of the class gets a copy. Unlike static members which are shared.

    And all of this is statically typed and compiles to plain C.. I love this odd little language.

    Oh, and I was retarded when I said it didn't support dynamic libraries earlier, it does but the arguments to the compiler are just kind of weird.
    Reply With Quote Edit / Delete Windows 7 Egypt Show Events Informative Informative x 2 (list)

  2. Post #1842
    Jaykin Bacon: Episode 3
    SteveUK's Avatar
    May 2005
    2,470 Posts
    http://code.google.com/p/chromiumembedded/ this is what Valve use for their webkit implementation afaik.
    I've been using the very similar Awesomium, and I would definitely use it over any kind of UI system (GWEN included), as it just makes itterating on the look and feel so much easier. Once Awesomium 1.7 is out, I'm hoping the purported performance gains are enough to have a HUD not take 2ms to update in the Source engine.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 4Informative Informative x 1 (list)

  3. Post #1843
    Gold Member
    nmagain's Avatar
    February 2010
    9,473 Posts
    i was bored so i made this with my little programming knowledge since i forgot everything


    Edited:

    i don't know what to make now, tell me something to make.
    Reply With Quote Edit / Delete Windows 7 Egypt Show Events Programming King Programming King x 1Artistic Artistic x 1 (list)

  4. Post #1844
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    i don't know what to make now, tell me something to make.
    your own language
    Reply With Quote Edit / Delete Australia Show Events Disagree Disagree x 9Agree Agree x 6Funny Funny x 2 (list)

  5. Post #1845
    Gold Member
    nmagain's Avatar
    February 2010
    9,473 Posts
    yes i will do that now it will be called topaz

    Edited:

    i will make it in python

    Edited:

    also i fixed the webm video
    my random generation is much better than minecraft
    Reply With Quote Edit / Delete Windows 7 Egypt Show Events Funny Funny x 5Informative Informative x 1Agree Agree x 1 (list)

  6. Post #1846
    Programming King and Most Patient Member 2013
    r0b0tsquid's Avatar
    December 2008
    1,244 Posts
    Added model loading to my shader toy thing. I'm using ROBO_DONUT's BSM lib.
    Here's the example model he provided, with some simple diffuse lighting:

    I really need to improve the dialog though, at current it's just a single giant button saying "load model" which takes up the entire tab.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Programming King Programming King x 4 (list)

  7. Post #1847
    Eudoxia's Avatar
    July 2009
    6,009 Posts
    Making Ruby faster:





    I have the foulest code ever that converts Ruby bytecode into C, compiles it and links it in to Ruby.

    Edited:

    and this is the C my thingy generates:

    I once did that with Lisp but the performance was such shit.
    Reply With Quote Edit / Delete Windows 7 Uruguay Show Events

  8. Post #1848
    Hruhf's Avatar
    September 2007
    632 Posts
    WARNING VIDEO HAS SOUND
    http://dl.hruhf.in/Particles_TPO_201...6.webmvp8.webm

    Doing more harm than good it seems.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Dumb Dumb x 4Funny Funny x 4Artistic Artistic x 2 (list)

  9. Post #1849
    Gold Member
    robmaister12's Avatar
    January 2008
    4,969 Posts
    [h2]WARNING! VIDEO HAS SOUND![/h2]
    [h2]WARNING! VIDEO HAS SOUND![/h2]
    [h2]WARNING! VIDEO HAS SOUND![/h2]






    WARNING VIDEO HAS SOUND
    [vid.]http://dl.hruhf.in/Particles_TPO_2012-04-23_21-51-57-86.webmvp8.webm[/vid]
    WARNING VIDEO HAS SOUND

    I bet you at least one person will still accidentally mouse over that.
    My speakers were off, but I turned them on to see just how loud it was, and at 5-10% it's pretty loud. I usually keep my speakers around 40-50% when I'm listening to music so this would have been painfully loud and a good 5-10x louder than anything else on my computer.

    Instead of slapping a bunch of warnings (which people won't even see/have time to react to when they're scrolling quickly through the page), why not just lower the volume before you upload. It would have taken the same time as writing all those warnings.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  10. Post #1850
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    Garry, for the love of god, please only autoplay videos in [autoplay] tags.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Agree Agree x 12 (list)

  11. Post #1851
    Samuka97's Avatar
    April 2007
    1,982 Posts
    WARNING VIDEO HAS SOUND
    http://dl.hruhf.in/Particles_TPO_201...6.webmvp8.webm

    Doing more harm than good it seems.
    Thank god I had my mouse go right over the video as I was scrolling down.
    Reply With Quote Edit / Delete Windows 7 Brazil Show Events

  12. Post #1852
    Hruhf's Avatar
    September 2007
    632 Posts
    My speakers were off, but I turned them on to see just how loud it was, and at 5-10% it's pretty loud. I usually keep my speakers around 40-50% when I'm listening to music so this would have been painfully loud and a good 5-10x louder than anything else on my computer.

    Instead of slapping a bunch of warnings (which people won't even see/have time to react to when they're scrolling quickly through the page), why not just lower the volume before you upload. It would have taken the same time as writing all those warnings.
    Wait it was loud?
    It was really quiet on my speakers.

    Edited:

    I am genuinely sorry, I thought the sound was quiet but it turns out my speakers were just really low.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Friendly Friendly x 2 (list)

  13. Post #1853
    Gold Member
    robmaister12's Avatar
    January 2008
    4,969 Posts
    Wait it was loud?
    It was really quiet on my speakers.
    People have different configurations, for me Windows' volume is at 67% and my speakers get pretty loud when I max them out.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  14. Post #1854
    Crescent fresh
    Perl's Avatar
    January 2011
    1,036 Posts
    Garry, for the love of god, please only autoplay videos in [autoplay] tags.
    it's just your browser, not garry's problem
    Reply With Quote Edit / Delete Windows 7 Estonia Show Events Disagree Disagree x 25Dumb Dumb x 4 (list)

  15. Post #1855
    calzoneman's Avatar
    February 2008
    460 Posts
    it's just your browser, not garry's problem
    How is it our problem that garry's setting the autoplay attribute on everyone's WebM videos?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 14 (list)

  16. Post #1856
    So I "finished" my Ludum Dare game: http://www.ludumdare.com/compo/ludum...view&uid=11248

    I kinda wanted too much so it doesn't have everything I wanted to add.. Such a shame.
    Well, update time!

    Timelapse:

    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Winner Winner x 1 (list)

  17. Post #1857
    Richy19's Avatar
    May 2010
    5,411 Posts
    WARNING VIDEO HAS SOUND
    http://dl.hruhf.in/Particles_TPO_201...6.webmvp8.webm

    Doing more harm than good it seems.
    I had my speakers on 50% and it really wasnt that bad
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Agree Agree x 1 (list)

  18. Post #1858
    Jaykin Bacon: Episode 3
    SteveUK's Avatar
    May 2005
    2,470 Posts
    Garry, for the love of god, please only autoplay videos in [autoplay] tags.
    Or get rid of auto play altogether because it's annoying and a colossal waste of bandwidth
    Reply With Quote Edit / Delete United Kingdom Show Events Agree Agree x 25Disagree Disagree x 2 (list)

  19. Post #1859
    Dotmister's Avatar
    May 2008
    898 Posts
    it's just your browser, not garry's problem
    Well since chrome refuse to add any options to their browser, it's garry's problem.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Disagree Disagree x 4 (list)

  20. Post #1860
    Strong Member
    thelinx's Avatar
    January 2007
    8,019 Posts
    Or get rid of auto play altogether because it's annoying and a colossal waste of bandwidth
    there's no way to not preload HTML5 videos atm
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  21. Post #1861
    Jaykin Bacon: Episode 3
    SteveUK's Avatar
    May 2005
    2,470 Posts
    there's no way to not preload HTML5 videos atm
    Who cares about pre-loading? What's wrong with having normal video controls and it loading the video when you hit play?

    edit: missed the stupid double negative. I just checked the spec, and there is actually an attribute for preloading behaviour. With preload="none" the video doesn't start buffering, however having the "autoplay" attribute overwrites it.
    Reply With Quote Edit / Delete United Kingdom Show Events Agree Agree x 7 (list)

  22. Post #1862
    Strong Member
    thelinx's Avatar
    January 2007
    8,019 Posts
    in the spec, yes, but no browser actually cares about the preload attribute

    at least, that's how it was about 4 months ago
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  23. Post #1863
    Gold Member
    nmagain's Avatar
    February 2010
    9,473 Posts
    WARNING VIDEO HAS SOUND
    http://dl.hruhf.in/Particles_TPO_201...6.webmvp8.webm

    Doing more harm than good it seems.
    nice visualizer and nicer song, name please !
    Reply With Quote Edit / Delete Windows 7 Egypt Show Events

  24. Post #1864
    Jaykin Bacon: Episode 3
    SteveUK's Avatar
    May 2005
    2,470 Posts
    in the spec, yes, but no browser actually cares about the preload attribute

    at least, that's how it was about 4 months ago
    http://www.longtailvideo.com/html5/preload/
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Informative Informative x 2Zing Zing x 2 (list)

  25. Post #1865
    Hruhf's Avatar
    September 2007
    632 Posts
    nice visualizer and nicer song, name please !
    "メイドと血の懐中時計 〜 MYTK mix"
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Funny Funny x 16 (list)

  26. Post #1866
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,626 Posts
    Got Google Play in-app-billing working. Man, Google made the interface so much more complicated than Apple's "Buy? Or not buy? 2 buttons!"
    Reply With Quote Edit / Delete Windows XP United States Show Events

  27. Post #1867
    Strong Member
    thelinx's Avatar
    January 2007
    8,019 Posts
    "メイドと血の懐中時計 〜 MYTK mix"
    which you can find http://www.youtube.com/watch?feature...KjlkS4#t=2222s
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Optimistic Optimistic x 2Winner Winner x 1 (list)

  28. Post #1868
    Kamshak's Avatar
    July 2008
    438 Posts
    [i was told to put this in waywo as there is no lopensteamworks thread:
    I have a problem translating a CPP script to lua, it crashes with some stack error

    In


    Sources
    Cpp
    Code:
    CSteamAPILoader loader;
        CreateInterfaceFn factory = loader.Load( );
    
        ISteamClient008 *steamClient = (ISteamClient008 *)factory( STEAMCLIENT_INTERFACE_VERSION_008, NULL );
        assert( steamClient );
    
        IClientEngine *clientEngine = (IClientEngine *)factory( CLIENTENGINE_INTERFACE_VERSION, NULL );
        assert( clientEngine );
    
        HSteamPipe steamPipe = steamClient->CreateSteamPipe( );
        cout << "Pipe: 0x" << hex << steamPipe << endl;
    
        HSteamUser steamUser = steamClient->ConnectToGlobalUser( steamPipe );
    
        IClientFriends *clientFriends = (IClientFriends *)clientEngine->GetIClientFriends( steamUser, steamPipe, CLIENTFRIENDS_INTERFACE_VERSION );
        assert( clientFriends );
    
        CallbackMsg_t callbackMsg;
        std::cout << "Started listening" << endl;
        while ( true )
        {
            if ( Steam_BGetCallback( steamPipe, &callbackMsg ) )
            {
                switch( callbackMsg.m_iCallback )
                {
                    case FriendChatMsg_t::k_iCallback:
                    {
                        FriendChatMsg_t *friendMessageInfo = (FriendChatMsg_t *)callbackMsg.m_pubParam;
    
                        //allocate some space
                        char pvData[4096];
    
                        CSteamID chatter;
                        EChatEntryType msgType;
                        int len = clientFriends->GetChatMessage(friendMessageInfo->m_ulSender, friendMessageInfo->m_iChatID, pvData, 4096, &msgType, &chatter);
                        std::string msg( pvData );
    
                        if( msgType != k_EChatEntryTypeChatMsg )
                        {
                            Steam_FreeLastCallback( steamPipe );
                            continue;
                        }
    
                        if( len > 0 )
                        {
                            std::cout << "received chat message from " << clientFriends->GetFriendPersonaName( chatter  ) << " : " << pvData << endl;
                            parser->parse( pvData, chatter );
                        }
                    }
                    break;
                }
                Steam_FreeLastCallback( steamPipe );
            }
            Session::getInstance( ).update( );
            parser->update( );
            Sleep(10);
        }
    Lua
    Code:
    require( "opensteamworks" )
    
    local hSteamPipe = ISteamClient012.CreateSteamPipe( )
    local hSteamUser = ISteamClient012.ConnectToGlobalUser( hSteamPipe )
    local steamFriends = ISteamClient012.GetISteamFriends( hSteamUser, hSteamPipe, "SteamFriends011" )
    local clientFriends = IClientEngine.GetIClientFriends( hSteamUser, hSteamPipe )
    
    while true do
        local b, callbackMsg = Steam_BGetCallback( hSteamPipe )
        if b then
            if callbackMsg.m_iCallback == 805 then
            
                local chatMsg = callbackMsg.m_pubParam
                local friendName = steamFriends:GetFriendPersonaName( chatMsg.m_ulSenderID )
                
                local steamId, msgType, strData, len = clientFriends:GetChatMessage( chatMsg.m_ulSender, chatMsg.m_iChatID )
                print( steamId, msgType, strData, len )
            end
            Steam_FreeLastCallback( hSteamPipe )
        end
    end
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  29. Post #1869
    Gold Member
    mechanarchy's Avatar
    September 2009
    1,214 Posts
    yay opengl, i now have instanced rendering working on some squares

    Reply With Quote Edit / Delete Australia Show Events

  30. Post #1870
    Crescent fresh
    Perl's Avatar
    January 2011
    1,036 Posts
    How is it our problem that garry's setting the autoplay attribute on everyone's WebM videos?
    why the hell doesn't autoplay work on any of my 3 computers then

    Edited:

    oh never mind everything autoplays, what's the problem with it though since it doesn't play with sound?
    Reply With Quote Edit / Delete Windows 7 Estonia Show Events Dumb Dumb x 1 (list)

  31. Post #1871
    Gold Member
    Deco Da Man's Avatar
    July 2007
    1,017 Posts
    steamworks win
    Are you wrapping all C API includes in extern "C" { .. }?
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Friendly Friendly x 1 (list)

  32. Post #1872
    Kamshak's Avatar
    July 2008
    438 Posts
    Are you wrapping all C API includes in extern "C" { .. }?
    im not using any modified code, just compiled amcs github lib
    in my original code i just include it normally

    Edit:
    oh to be clear, the lua one crashes, the cpp one works perfectly fine
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  33. Post #1873
    Gold Member
    Deco Da Man's Avatar
    July 2007
    1,017 Posts
    im not using any modified code, just compiled amcs github lib
    in my original code i just include it normally

    Edit:
    oh to be clear, the lua one crashes, the cpp one works perfectly fine
    Did you make the project file yourself?

    If so, check that you haven't added lua.h, luaconf.h, or lauxlib.h to the build process inadvertently.
    I'm not entirely sure, but it's logical to assume that they should be included by the source only so that it can use extern "C".
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  34. Post #1874
    Kamshak's Avatar
    July 2008
    438 Posts
    the test scripts all work fine, it also uses lua.hpp which i think does all the extern C etc, the project file was provided but i compile lua in directly instead of using the static lib but i dont think that's the problem
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  35. Post #1875
    Jaykin Bacon: Episode 3
    SteveUK's Avatar
    May 2005
    2,470 Posts
    why the hell doesn't autoplay work on any of my 3 computers then

    Edited:

    oh never mind everything autoplays, what's the problem with it though since it doesn't play with sound?
    Bandwidth. It does play with sound, when you mouse over it, which can be done accidentally. It's just all in all a bad design choice and is why I used the userscript to get rid of it and restores the default HTML5 video controls.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 6 (list)

  36. Post #1876
    Hruhf's Avatar
    September 2007
    632 Posts
    Bandwidth. It does play with sound, when you mouse over it, which can be done accidentally. It's just all in all a bad design choice and is why I used the userscript to get rid of it and restores the default HTML5 video controls.
    Even defaulting to muted would be a big improvement.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  37. Post #1877
    ben1066's Avatar
    August 2009
    1,101 Posts
    So last I checked SSAO was meant to be more than all black right?
    Reply With Quote Edit / Delete Windows 8 United Kingdom Show Events Funny Funny x 4 (list)

  38. Post #1878
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    why the hell doesn't autoplay work on any of my 3 computers then

    Edited:

    oh never mind everything autoplays, what's the problem with it though since it doesn't play with sound?
    The auto mute script kicks in after everything on the page has loaded.
    Autoplay kicks in as soon as the first few frames of the video in question have loaded.
    Slowpunch, huge gifs, other videos or just slow internet can give you an unexpected earful of hell just from normal browsing. This is especially horrible if the video has programmer music on it and a) you have headphones on, b) you are zoning out and listening to something soft or c) you aren't listening to anything at all and therefore had no idea how loud your speakers were set to
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  39. Post #1879
    Winded's Avatar
    April 2012
    111 Posts
    My first Windows API program. Old joke but I decided to do this anyway. Still WIP. Been making this for like 10 hours in the last 4 days :/

    Gabe will move whenever you try to put your cursor on the image. (in the program, not the image )
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Dumb x 18Funny x 1Optimistic x 1Useful x 1Informative x 1 (list)

  40. Post #1880
    Robots FTW
    SiPlus's Avatar
    December 2011
    888 Posts

    Testing Managed DirectSound.
    Reply With Quote Edit / Delete Windows 8 Russian Federation Show Events Informative Informative x 1 (list)