Jump to content

Search the Community

Showing results for tags 'OOP'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General X-Plane Discussion
    • General Discussion
    • File Library Submissions
    • Help!?!
    • Communal Links
    • Screenshots
    • Videos
    • X-Plane News [Official News]
    • X-Pilot Features
  • Developers
    • Plugin Development
    • UDP Development
    • Aircraft Development
    • Scenery Development
  • Freeware Projects
    • XMidiCtrl
  • Commercial Vendors
    • 4Forces
    • Attitude Simulations
    • Hot Start
    • ITX-Designs (Formerly Icarus)
    • IXEG
    • JGX-Designs
    • JRollon
    • Leading Edge Simulations
    • Maxx-XP
    • PilotEdge
    • RealScenery
    • RealSimGear
    • Real Environment Simulations
    • TOGA Simulations
    • TorqueSim/AFM
    • Uncle Jack Simulations
    • X-Plugins
  • Miscellaneous
    • Hardware
    • Software
  • X-Plane 101
    • I'm New To X-Plane!
    • Best of the Best!
  • Workshop
    • 3D Shop
  • Add-On Reviews
    • Reviews

Categories

  • News
  • Aircraft
  • Scenery
  • Plugins
  • X-Pilot Website
  • Sales & Deals
  • General Information

Categories

  • Aircraft
    • Experimental
    • Fighters
    • General Aviation
    • Gliders
    • Heavy Metal
    • Helicopters
    • Mega-Planes
    • Seaplanes
    • VTOL
    • X-Planes
  • Scenery
    • DSF Scenery Packages
    • Objects
    • Misc Scenery Resources
  • Liveries
    • Business Aviation
    • Experimental
    • Fighters
    • General Aviation
    • Helicopters
    • Heavy Metal
    • Vintage
  • Plugins and Utilities

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. I am experimenting with OOP programming in LUA. I have made a class (soundClass). Based on this class several sound objects are made, e.g. Wind. I want to have an automatic method for assigning and releasing sound sources. This way it is possible to keep the used sound sources to a minimum. Only the playing sources are attached to a sound source, after stopping the sound it is released from the source and it can be assigned to a new sound that must start playing. For releasing the sounds there are two situation I have to deal with: 1. My application decides it is time to stop 2. The sound is stopped because the end of the soundfile is reached The first situation is an easy, because in this case a field of the object is changed and it is very easy to create an event-procedure for it. For the second I don't know how to determine the event, because no field of the object is changed after the soundfile has come to an end (OpenAL have an extra challenge because it has no events itself), I have to check the source state myself (if al.GetSource(source_id,al.SOURCE_STATE) == al.STOPPED do release_sound end). The source_id is stored in the field source of the soundobject, e.g. Wind.source. Is it possible to have the created objects checking each frame if the sound is stopped? Of course it is possible to check it in the OnUpdate() function of my main program myself, but this is a more stupid approach. I want to realize this in the "class", so I have to write it once and don't need to worry about it ever. My second problem with this solution is that I have to write a method call for each sound object I created.
×
×
  • Create New...