Commit graph

1050 commits

Author SHA1 Message Date
jp9000 0b4a259e56 Remove 'locale' parameter from all callbacks
The locale parameter was a mistake, because it puts extra needless
burden upon the module developer to have to handle this variable for
each and every single callback function.  The parameter is being removed
in favor of a single centralized module callback function that
specifically updates locale information for a module only when needed.
2014-06-25 12:36:26 -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
jp9000 899f053034 Add API for setting/getting current locale
This API is used to set the current locale for libobs, which it will set
for all modules when a module is loaded or specifically when the locale
is manually changed.
2014-06-25 12:36:17 -07:00
jp9000 9f652e6416 Make settings window only save data that changes
Currently, if a user presses 'OK' or 'Apply' on the settings window, it
will save all data from all controls on a settings pane, regardless of
whether of not they were changed.  The major issue with this is that
setting the data will overwrite all default values, making it impossible
for default values to be used if a user didn't actually change a value.
(Thanks to palana for pointing this fact out)

So instead, mark a control as 'changed' using QObject::property() and
QObject::sender(), and add a few helper functions to controls to ensure
that they are checked to see whether they were actually changed directly
by the user before saving the value to the config.
2014-06-23 19:59:22 -07:00
Jim f431decf16 Merge pull request #123 from Arkkis/patch-2
Update fi.txt
2014-06-23 10:07:25 -07:00
Arkkis 81479e0e7d Update fi.txt 2014-06-23 19:56:07 +03:00
jp9000 1ac859f5ed Do not clamp aspect by default when using bounds
If the scene item has a bounding box set up for it, do not make it use
aspect ratio clamping by default.

Instead, make it so that shift will turn on aspect ratio, and make it
also apply to all types of bounding box modes.

The only time where aspect ratio clamping should apply by default is
when bounds are not in use (i.e. when a source is just created).  Some
will disagree with me just because that's how photoshop does it, but
we're not photoshop, and I feel that the majority of users will have
more trouble with it disabled by default than enabled by default.

So to sum it up:

If bounds inactive, clamp aspect ratio by default, because scene items
start out with it inactive, and it directly affects the scale.

If bounds active, do not clamp aspect ratio by default, because clamping
to aspect ratio doesn't particularly have an effect for mode bounds
modes except for "stretch to bounds".
2014-06-22 23:53:39 -07:00
jp9000 aef8c218c0 Make 'center to screen' just center the source
Instead of using bounds to force the source to be centered (and
unrotated), just center the source positionally on the screen.  Will
also preserve rotation.
2014-06-22 23:49:57 -07:00
jp9000 933f5787d0 UI: Change transform value 'scale' to 'size'
There's no reason to represent this value in terms of scale.  Scale is a
useless value for users to use.  What are they going to enter, 0.5?
2.0?  0.25?

Even if it can be subject to change by the source itself, and even if
it's still converted to scale internally, having it display the base
source size value is much more ideal for the user.
2014-06-22 17:37:06 -07:00
Jim bd4223a20c Merge pull request #116 from palana/obs-data-changes
obs-data default value semantics change and autoselect value introduction
2014-06-22 14:09:38 -07:00
Jim 79619d0691 Merge pull request #121 from BtbN/fixes
Honor QUIET argument in FindJansson
2014-06-22 14:01:08 -07:00
Jim e430ff3a52 Merge pull request #122 from reboot/fix_xcomposite_config_loss
Fix that the xcomposite configuration is lost when source is recreated
2014-06-22 14:00:54 -07:00
Christoph Hohmann fdf1b25c07 linux-xcomposite: Fix that the configuration is lost when source is recreated 2014-06-22 12:51:58 +02:00
Palana dfc8f51785 Make properties-view reflect autoselect settings (for property lists) 2014-06-22 01:33:37 +02:00
Palana c2bb95250b Add obs-data autoselect functions
These are meant to reflect auto-detection configuration changes that
should not be written to the config, for example, frame rate changes
for a camera where the (user-/config-file-)configured frame rate isn't
available but a similar frame rate can be automatically chosen
2014-06-22 01:32:09 +02:00
Palana 7f172eb1b4 Change semantics of obs-data default values
Default values are now permanently stored in the obs_data_items and
can be accessed via the new get_default functions

Also default values are no longer serialized to JSON to ease transition
to new default values
2014-06-22 01:32:09 +02:00
Palana a6b52156b2 Move obs-data accessor value handling logic into static helper functions 2014-06-22 01:32:09 +02:00
Palana 7cbc260f90 Unify obs_data_set* and obs_data_item_set* funtion implementations 2014-06-22 01:32:09 +02:00
Palana 92e9284270 Refactor obs-data internals to forward reallocation results to callers 2014-06-22 01:32:09 +02:00
Palana 0d77dc702d Refactor set_item(_def) to only look up items if no item is supplied 2014-06-22 01:32:09 +02:00
Palana 23e2f623f9 Unify obs_data_set* and obs_data_set_default_* function implementations 2014-06-22 01:32:08 +02:00
Palana f29f4d8009 Unify obs_data_get* and obs_data_item_get* functions handling 2014-06-22 01:32:08 +02:00
Palana b5f56ff579 Highlight label in properties-view when a disabled list item is selected 2014-06-21 22:31:23 +02:00
jp9000 5b5ef6aaf7 Merge branch 'bazukas-v4l2-input' 2014-06-19 22:08:07 -07:00
jp9000 68f7191549 Merge branch 'v4l2-input' of https://github.com/bazukas/obs-studio into bazukas-v4l2-input 2014-06-19 21:57:42 -07:00
jp9000 b9ab48c70c linux-xshm: Fix cursor draw position
Due to the recent change with matrices, the way space is represented by
matrices is a bit different.  The matrix stack represents the view
matrix, rather than the model matrix, so the position is more
representative of the camera (view) itself, rather than that of the
objects (model).
2014-06-19 20:55:30 -07:00
Azat Khasanshin 32911f774c v4l2 plugin properties
added ability to choose device, pixel format, resolution
and frame rate
2014-06-18 23:37:19 +04:00
fryshorts 5f8a6db816 Add initial implementation of a v4l2 capture plugin
This patch adds a plugin to capture video data from v4l2 devices under linux.
2014-06-18 21:31:23 +02:00
BtbN 6d8146f6f0 Honor QUIET argument in FindJansson 2014-06-18 06:24:21 +02:00
Jim e7dfdbae70 Merge pull request #117 from Arkkis/patch-1
Update fi.txt
2014-06-17 15:52:10 -07:00
Arkkis 05d75a7792 Update fi.txt 2014-06-18 01:50:59 +03:00
Palana d815831012 Make properties-view respect disabled list entries 2014-06-17 17:03:27 +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
Palana 6654473fa0 Restore compatibility with released Jansson versions 2014-06-17 17:02:41 +02:00
Palana 56b3685940 Add include for ptrdiff_t 2014-06-17 17:02:28 +02:00
jp9000 7c8ef6f6ef rtmp-common: Apply service encoder settings
Common services that require specific encoder settings (specified in the
'recommended' section of the json file) will now have those encoder
settings applied before the encoders start up.

This fixes the issue with services like twitch that weren't getting
their required 2-second keyframe maximum interval set.
2014-06-16 21:39:27 -07:00
jp9000 9b23914c37 libobs: Add 'initialize' callback to services
The 'initialize' callback is used before the encoders/output start up so
it can adjust encoder settings to required values if needed.

Also added the function 'obs_encoder_active' that returns true or false
depending on whether that encoder is active or not.
2014-06-16 21:37:53 -07:00
jp9000 85ee5d591b UI: Open properties on user source creation
Every time I created a source I found myself in need to actually open up
the properties.  It was getting somewhat on my nerves, so I decided to
just make it automatically pop up when the source is created.
2014-06-16 19:45:47 -07:00
Jim dfabbf7936 Merge pull request #111 from antihax/cleanup
Removed unresolved EXPORT from previous revision of volume meter & modified locale not found error.
2014-06-16 18:13:20 -07:00
jp9000 ed5b4f590c Fix a number of warnings
Structures with anonymous unions would a warning when you do a brace
assignment on them.

Also fixed some unused parameters and removed some unused variables.
2014-06-16 17:55:48 -07:00
Danni af1408d84f Removed unresolved EXPORT from previous revision of volume meter 2014-06-16 18:52:55 -05:00
jp9000 f937d66fab UI: Allow editing outside of inner preview bounds 2014-06-16 15:38:43 -07:00
Jim 111c4e84d2 Merge pull request #114 from jp9000/scene-editing
Scene editing
2014-06-15 20:44:37 -07:00
jp9000 98ddb846dc UI: Add padding to scene edges for editing
Add a 10 pixel padding to the sides and remove viewport cutting to
ensure that the editing rectangles are visible even when in the upper
corners.

Also, add a black background for the actual 'scene' in the preview
window so that the scene boundries are actually visible in relation to
the rest of the preview space.
2014-06-15 20:33:13 -07:00
jp9000 452e0695f4 UI: Add scene editing
So, scene editing was interesting (and by interesting I mean
excruciating).  I almost implemented 'manipulator' visuals (ala 3dsmax
for example), and used 3 modes for controlling position/rotation/size,
but in a 2D editing, it felt clunky, so I defaulted back to simply
click-and-drag for movement, and then took a similar though slightly
different looking approach for handling scaling and reszing.

I also added a number of menu item helpers related to positioning,
scaling, rotating, flipping, and resetting the transform back to
default.

There is also a new 'transform' dialog (accessible via menu) which will
allow you to manually edit every single transform variable of a scene
item directly if desired.

If a scene item does not have bounds active, pulling on the sides of a
source will cause it to resize it via base scale rather than by the
bounding box system (if the source resizes that scale will apply).  If
bounds are active, it will modify the bounding box only instead.

How a source scales when a bounding box is active depends on the type of
bounds being used.  You can set it to scale to the inner bounds, the
outer bounds, scale to bounds width only, scale to bounds height only,
and a setting to stretch to bounds (which forces a source to always draw
at the bounding box size rather than be affected by its internal size).
You can also set it to be used as a 'maximum' size, so that the source
doesn't necessarily get scaled unless it extends beyond the bounds.

Like in OBS1, objects will snap to the edges unless the control key is
pressed.  However, this will now happen even if the object is rotated or
oriented in any strange way.  Snapping will also occur when stretching
or changing the bounding box size.
2014-06-15 20:33:13 -07:00
jp9000 b23f8cc6e1 Scenes: Implement more item positioning features
There are a ridiculous number of features related to scaling and
positioning due to requests by a number of people who complained that
they hated the way that OBS1 would always resize their sources when the
source's base size changed.  There were also people who wanted more
control for how the resizing was handled, or the ability to completely
prevent resizing entirely if desired.  So I made it so that you can
optionally use a 'bounds' system, which allows you to specify different
styles of controlling resizing.

If disabled, the source will always automatically resize and only the
base scale is applied.  If enabled, you have a variety of different ways
to limit/control how it can resize within the bounds, or make it so it
can't resize at all.  You can also control alignment within that
bounding box, so you can make it so that a source always aligns to a
side or corner of the box.

I also added an alignment value which changes how the source is oriented
relative to the position of the scene item.  For example, setting
bottom-right alignment will make it so that the position of the item is
the bottom right corner of the source.  When the source resizies, it
will resize leftward and upward in that case, which solves the problem
of how a source resizes relative to a desired position.
2014-06-15 20:33:13 -07:00
jp9000 254d830c08 Make a minor OCD tweak to align parameters 2014-06-15 00:14:08 -07:00
jp9000 65f84cf356 Add solid_effect variable to obs_core_video 2014-06-14 23:59:39 -07:00
jp9000 89df81e72d libobs: Add helper functions for math data 2014-06-14 23:57:00 -07:00