Commit graph

36 commits

Author SHA1 Message Date
jamacanbacn 8a59d68e47 libobs: Fix property text typo
(This commit also modifies UI)

Closes jp9000/obs-studio#1204
2018-02-27 05:37:40 -08:00
jp9000 fd9e5d45a3 libobs: Add obs_property_set_modified_callback2
Allows the ability to pass private data to a callback (useful
specifically for scripting purposes).
2018-01-03 17:04:04 -08:00
jp9000 6d628c1ceb libobs: Add obs_properties_add_button2
Allows passing button-specific private data to the button callback
rather than just passing the private data of the properties object.
2018-01-03 17:04:04 -08:00
jp9000 c99f65a0df libobs: Add property functions to mod. int/double limits 2016-09-19 07:04:00 -07:00
jp9000 ac4bd2aa80 libobs: Add long description to properties
Allows setting a "long" description for detailed explanation of certain
properties that may need them, but don't want to display them on the
user interface by default.
2016-07-20 08:09:45 -07:00
jp9000 07a26b1720 libobs: Add more editable list types
(Note: This commit also modifies the UI)

The editable list only had two types: A type that allows both files and
URLS, and a type that only allows strings.

This changes it so the editable list can have a "files only" type, a
"files and URLs" type, and a "strings only" type.
2016-05-26 10:55:51 -07:00
partouf d75ed15037 libobs: Add file saving to file property
(This commit also modifies the UI)

Closes jp9000/obs-studio#502
2016-02-07 16:33:57 -08:00
Palana 1b078f57d8 libobs: Add frame rate property 2015-11-14 15:37:59 +01:00
jp9000 a752b32b83 libobs: Add editable list property
Add an editable list property, primarily used for adding files to a
playlist for example.
2015-06-02 17:01:38 -07:00
jp9000 0a8e3a643c libobs: Add int/float slider properties
This optionally specifies that the int/float value should be displayed
with a slider rather than and up/down control.  UIs are not necessarily
required to implement it, it's meant to be more of a hint.
2015-03-22 19:18:06 -07:00
jp9000 ef4ee1fd1a libobs: Implement flags for properties
OBS_PROPERTIES_DEFER_UPDATE: Makes it so the properties are not updated
until editing of the properties is complete.
2015-03-19 15:57:03 -05:00
jp9000 cb8acd59ce libobs: Export obs_properties_apply_settings
I didn't think it would ever need to be exported, but this function is
actually useful for applying settings to properties (to call all of
their update callbacks based upon the settings) without necessarily
having to have an object associated with it.
2015-02-04 16:51:59 -08:00
jp9000 32ca251bb0 libobs: Add obs_property_set_description
This allows us to change the visible UI name of a property after it's
been created (particularly for a case where I want to change an
'Activate' button to 'Deactivate')
2015-01-03 20:46:18 -08:00
jp9000 a69524a271 libobs: Add obs_property_list_insert_* functions
These functions allow you to insert items at a specific index in a list
instead of being forced to always append to the end.
2014-12-09 14:21:02 -08:00
fryshorts 5524711e54 Some documentation improvements in obs-properties.h
Create a stub for the documentation page.
2014-10-19 15:00:07 +02:00
jp9000 c9df41c1e2 (API Change) Remove pointers from all typedefs
Typedef pointers are unsafe.  If you do:
typedef struct bla *bla_t;
then you cannot use it as a constant, such as: const bla_t, because
that constant will be to the pointer itself rather than to the
underlying data.  I admit this was a fundamental mistake that must
be corrected.

All typedefs that were pointer types will now have their pointers
removed from the type itself, and the pointers will be used when they
are actually used as variables/parameters/returns instead.

This does not break ABI though, which is pretty nice.
2014-09-25 21:48:11 -07:00
jp9000 0bf9736ddd Add font property
Adds the following function:
------------------------------
obs_properties_add_font

This function creates a 'font' property to allow selection of a system
font.  Implementation by the UI should treat the setting as an obs_data
sub-object with four sub-items:
 - face:   face name (string)
 - style:  style name (string)
 - size:   size (integer)
 - flags:  font flags (integer)

'flags' can be any combination of the following values:
 - OBS_FONT_BOLD
 - OBS_FONT_ITALIC
 - OBS_FONT_UNDERLINE
 - OBS_FONT_STRIKEOUT
2014-08-18 00:14:02 -07:00
Palana 77bb225910 Add OBS_TEXT_MULTILINE for text obs properties 2014-07-21 04:31:19 +02:00
jp9000 4812a6130c libobs: Fill in rest of 'path' property code
A path should have a filter, default search directory, and a way to
indicate whether or not a directory or file is desired.
2014-06-28 10:12:57 -07:00
Jim 2ea50cab36 Merge pull request #124 from jp9000/new-locale-handling
Update to new module locale API
2014-06-25 12:58:05 -07:00
jp9000 74b4743bce Remove 'locale' from properties
Having the value stored here is somewhat pointless, so this is one step
in fixing the locale handling.  Locale should be handled by the modules
themselves with their own loaded locale lookup information.
2014-06-25 12:36:26 -07:00
Palana 113454a2c8 Fix export for obs_property_list_item_remove 2014-06-25 15:29:00 +02:00
Palana e007d02c21 Allow property list entries to be disabled
This allows, for example, disconnected devices for dshow/avcapture to
be listed (and to stay selected in the user config) while making them
unavailable for selection in new sources
2014-06-17 17:03:27 +02:00
Palana ed7b37b522 Return index of added property list entry 2014-06-17 17:03:27 +02:00
jp9000 85dcfcaa34 libobs: Add button support to properties
This adds button support to properties, which will allow a properties
pane to let the user click a button to activate something with a
particular obs context.  When pressed, the button will execute the
callback given, with the context's private data as a parameter.
2014-05-30 02:16:46 -07:00
jp9000 7a60694159 obs-properties: Add a few features
Just wanted the ability to be able to add private data to the properties
data.  Makes it a little easier to manage data if you get updates from
controls.
2014-04-19 20:29:11 -07:00
jp9000 92522d1886 Implement RTMP module (still needs drop code)
- Implement the RTMP output module.  This time around, we just use a
   simple FLV muxer, then just write to the stream with RTMP_Write.
   Easy and effective.

 - Fix the FLV muxer, the muxer now outputs proper FLV packets.

 - Output API:
   * When using encoders, automatically interleave encoded packets
     before sending it to the output.

   * Pair encoders and have them automatically wait for the other to
     start to ensure sync.

   * Change 'obs_output_signal_start_fail' to 'obs_output_signal_stop'
     because it was a bit confusing, and doing this makes a lot more
     sense for outputs that need to stop suddenly (disconnections/etc).

 - Encoder API:
   * Remove some unnecessary encoder functions from the actual API and
     make them internal.  Most of the encoder functions are handled
     automatically by outputs anyway, so there's no real need to expose
     them and end up inadvertently confusing plugin writers.

   * Have audio encoders wait for the video encoder to get a frame, then
     start at the exact data point that the first video frame starts to
     ensure the most accrate sync of video/audio possible.

   * Add a required 'frame_size' callback for audio encoders that
     returns the expected number of frames desired to encode with.  This
     way, the libobs encoder API can handle the circular buffering
     internally automatically for the encoder modules, so encoder
     writers don't have to do it themselves.

 - Fix a few bugs in the serializer interface.  It was passing the wrong
   variable for the data in a few cases.

 - If a source has video, make obs_source_update defer the actual update
   callback until the tick function is called to prevent threading
   issues.
2014-04-07 22:00:10 -07:00
jp9000 1bca7e0a3e Improve properties API
Improve the properties API so that it can actually respond somewhat to
user input.  Maybe later this might be further improved or replaced with
something script-based.

When creating a property, you can now add a callback to that property
that notifies when the property has been changed in the user interface.
Return true if you want the properties to be refreshed, or false if not.
Though now that I think about it I doubt there would ever be a case
where you would have this callback and *not* refresh the properties.

Regardless, this allows functions to change the values of properties or
settings, or enable/disable/hide other property controls from view
dynamically.
2014-04-04 00:30:37 -07:00
jp9000 4a652ec82d obs-output module: Fill out more functions
- Add start/stop code to obs-output module

 - Use a circular buffer for the buffered encoder packets instead of a
   dynamic array

 - Add pthreads.lib as a dependency to obs-output module on windows in
   visual studio project files

 - Fix an windows export bug for avc parsing functions on windows.
   Also, rename those functions to be more consistent with each other.

 - Make outputs use a single function for encoded data rather than
   multiple functions

 - Add the ability to make 'text' properties be passworded
2014-04-02 00:42:12 -07:00
jp9000 d9251f9e87 Add source properties window (very preliminary)
- Add a properties window for sources so that you can now actually edit
   the settings for sources.  Also, display the source by itself in the
   window (Note: not working on mac, and possibly not working on linux).

   When changing the settings for a source, it will call
   obs_source_update on that source when you have modified any values
   automatically.

 - Add a properties 'widget', eventually I want to turn this in to a
   regular nice properties view like you'd see in the designer, but
   right now it just uses a form layout in a QScrollArea with regular
   controls to display the properties.  It's clunky but works for the
   time being.

 - Make it so that swap chains and the main graphics subsystem will
   automatically use at least one backbuffer if none was specified

 - Fix bug where displays weren't added to the main display array

 - Make it so that you can get the properties of a source via the actual
   pointer of a source/encoder/output in addition to being able to look
   up properties via identifier.

 - When registering source types, check for required functions (wasn't
   doing it before).  getheight/getwidth should not be optional if it's
   a video source as well.

 - Add an RAII OBSObj wrapper to obs.hpp for non-reference-counted
   libobs pointers

 - Add an RAII OBSSignal wrapper to obs.hpp for libobs signals to
   automatically disconnect them on destruction

 - Move the "scale and center" calculation in window-basic-main.cpp to
   its own function and in its own source file

 - Add an 'update' callback to WASAPI audio sources
2014-03-23 01:07:54 -07:00
jp9000 348588254c Add WASAPI audio capture
- Add WASAPI audio capture for windows, input and output

 - Check for null pointer in os_dlopen

 - Add exception-safe 'WinHandle' and 'CoTaskMemPtr' helper classes that
   will automatically call CloseHandle on handles and call CoTaskMemFree
   on certain types of memory returned from windows functions

 - Changed the wide <-> MBS/UTF8 conversion functions so that you use
   buffers (like these functions are *supposed* to behave), and changed
   the ones that allocate to a different naming scheme to be safe
2014-03-04 07:07:13 -07:00
jp9000 9c6da6f52d Split output/input audio capture sources
- Split input and output audio captures so that they're different
   sources.  This allows easier handling and enumeration of audio
   devices without having to do some sort of string processing.

   This way the user interface code can handle this a bit more easily,
   and so that it doesn't confuse users either.  This should be done for
   all audio capture sources for all operating systems.  You don't have
   to duplicate any code, you just need to create input/output wrapper
   functions to designate the audio as input or output before creation.

 - Make it detect soundflower and wavtap devices as mac "output" devices
   (even though they're actually input) for the mac output capture, and
   make it so that users can select a default output capture and
   automatically use soundflower or wavtap.

   I'm not entirely happy about having to do this, but because mac is
   designed this way, this is really the only way to handle it that
   makes it easier for users and UI code to deal with.

   Note that soundflower and wavtap are still also designated as input
   devices, so will still show up in input device enumeration.

 - Remove pragma messages because they were kind polluting the other
   compiler messages and just getting in the way.  In the future we can
   just do a grep for TODO to find them.

 - Redo list property again, this time using a safer internal array,
   rather than requiring sketchy array inputs.  Having functions handle
   everything behind the scenes is much safer.

 - Remove the reference counter debug log code, as it was included
   unintentionally in a commit.
2014-03-03 02:56:54 -07:00
jp9000 b4ef6cee91 Remove categories from properties
Categories added an unnecessary complexity to making properties, and
would very likely almost never be used in most cases, and were more of a
display feature.  The main issue is that it made property data more
complex to work with, and I just didn't feel comfortable with that.

Also, added a function to allow you to retrieve a porperty just by its
name.
2014-03-02 21:19:44 -07:00
jp9000 1eeece5b97 Simplify and improve 'list' property
When a source/output/etc has a property of a 'list' type, there was no
way to get the names associated with its values.  That, and it only
supported lists of either text, or enums (0..[value] only).

Now, you can associate translated names with those values, and use
integer, float, or string values.  Put it all in to one function as well
to simplify its usage.

I plan on using this to help get enumerations from devices/etc for
certain types of sources.  For example, if I get the properties of an
audio source, I'd like to have a list of available devices with it as
well.
2014-03-02 06:32:47 -07:00
jp9000 458325fc6f Add property list callbacks
- Add property list callbacks to sources/outputs/encoders so that if
  necessary user interface can be automatically generated or perhaps a
  property list widget can be used for them.

- Change some of the property API names.  obs_property_list_t felt a bit
  awkward when actually using it, so I just renamed it to
  obs_properties_t.

- Removed the getdata/setdata nad getparam/setparam functions from
  sources/services, they will be superseded by the dynamic procedure
  call API.
2014-02-01 22:46:13 -07:00
jp9000 0d17d13116 Implement properties definition interface
Implement a properties definition interface to allow modules to export
general properties associated with objects of libobs.

The properties definition interface allows the option for automatic
settings UI generation (which will make simple plugins easier to develop
without the need for user interface), as well as allow real-time
property editing of values of things like sources/outputs/etc without
having to open property dialogs.  More property types can be added in
the future as needed as well.
2014-02-01 18:01:31 -07:00