(void)input;
unsigned int count = 0;
unsigned int* array = NULL;
- ilm_getScreenIDs(&count, &array);
+
+ ilmErrorTypes callResult = ilm_getScreenIDs(&count, &array);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get screen IDs\n";
+ return;
+ }
+
printArray("Screen", array, count);
}
else if (input->contains("layers"))
(void)input;
int count = 0;
unsigned int* array = NULL;
- ilm_getLayerIDs(&count, &array);
+
+ ilmErrorTypes callResult = ilm_getLayerIDs(&count, &array);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get layer IDs\n";
+ return;
+ }
+
printArray("Layer", array, count);
}
else if (input->contains("surfaces"))
(void)input;
int count = 0;
unsigned int* array = NULL;
- ilm_getSurfaceIDs(&count, &array);
+
+ ilmErrorTypes callResult = ilm_getSurfaceIDs(&count, &array);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get surface IDs\n";
+ return;
+ }
+
printArray("Surface", array, count);
}
}
{
if (input->contains("screen"))
{
- ilm_takeScreenshot(input->getUint("id"),
- input->getString("file").c_str());
+ ilmErrorTypes callResult = ilm_takeScreenshot(input->getUint("id"),
+ input->getString("file").c_str());
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to take screenshot of screen with ID " << input->getUint("id") << "\n";
+ return;
+ }
}
else if (input->contains("layer"))
{
- ilm_takeLayerScreenshot(input->getString("file").c_str(),
- input->getUint("id"));
+ ilmErrorTypes callResult = ilm_takeLayerScreenshot(input->getString("file").c_str(),
+ input->getUint("id"));
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to take screenshot of layer with ID " << input->getUint("id") << "\n";
+ return;
+ }
}
else if (input->contains("surface"))
{
- ilm_takeSurfaceScreenshot(input->getString("file").c_str(),
- input->getUint("id"));
+ ilmErrorTypes callResult = ilm_takeSurfaceScreenshot(input->getString("file").c_str(),
+ input->getUint("id"));
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to take screenshot of surface with ID " << input->getUint("id") << "\n";
+ return;
+ }
}
}
COMMAND("set layer|surface <id> source region <x> <y> <w> <h>")
//=============================================================================
{
+ t_ilm_uint id = input->getUint("id");
+ t_ilm_uint x = input->getUint("x");
+ t_ilm_uint y = input->getUint("y");
+ t_ilm_uint w = input->getUint("w");
+ t_ilm_uint h = input->getUint("h");
+
if (input->contains("layer"))
{
- ilm_layerSetSourceRectangle(input->getUint("id"),
- input->getUint("x"),
- input->getUint("y"),
- input->getUint("w"),
- input->getUint("h"));
+ ilmErrorTypes callResult = ilm_layerSetSourceRectangle(id, x, y, w, h);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set source rectangle (" << x << "," << y << ", "<< w << ", " << h <<") for layer with ID " << id << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
else if (input->contains("surface"))
{
- ilm_surfaceSetSourceRectangle(input->getUint("id"),
- input->getUint("x"),
- input->getUint("y"),
- input->getUint("w"),
- input->getUint("h"));
- ilm_commitChanges();
+ ilmErrorTypes callResult = ilm_surfaceSetSourceRectangle(id, x, y, w, h);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set source rectangle (" << x << ", " << y << ", "<< w << ", " << h <<") for surface with ID " << id << "\n";
+ return;
+ }
+
+ ilm_commitChanges();
}
}
COMMAND("set layer|surface <id> destination region <x> <y> <w> <h>")
//=============================================================================
{
+ t_ilm_uint id = input->getUint("id");
+ t_ilm_uint x = input->getUint("x");
+ t_ilm_uint y = input->getUint("y");
+ t_ilm_uint w = input->getUint("w");
+ t_ilm_uint h = input->getUint("h");
+
if (input->contains("layer"))
{
- ilm_layerSetDestinationRectangle(input->getUint("id"),
- input->getUint("x"),
- input->getUint("y"),
- input->getUint("w"),
- input->getUint("h"));
+ ilmErrorTypes callResult = ilm_layerSetDestinationRectangle(id, x, y, w, h);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << x << ", " << y << ", "<< w << ", " << h <<") for layer with ID " << id << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
else if (input->contains("surface"))
{
- ilm_surfaceSetDestinationRectangle(input->getUint("id"),
- input->getUint("x"),
- input->getUint("y"),
- input->getUint("w"),
- input->getUint("h"));
+ ilmErrorTypes callResult = ilm_surfaceSetDestinationRectangle(id, x, y, w, h);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << x << ", " << y << ", "<< w << ", " << h <<") for surface with ID " << id << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
}
COMMAND("set layer|surface <id> opacity <opacity>")
//=============================================================================
{
+ t_ilm_uint id = input->getUint("id");
+ double opacity = input->getDouble("opacity");
+
if (input->contains("layer"))
{
- ilm_layerSetOpacity(input->getUint("id"),
- input->getDouble("opacity"));
+ ilmErrorTypes callResult = ilm_layerSetOpacity(id, opacity);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set opacity "<< opacity << " for layer with ID " << id << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
else if (input->contains("surface"))
{
- ilm_surfaceSetOpacity(input->getUint("id"),
- input->getDouble("opacity"));
- ilm_commitChanges();
+ ilmErrorTypes callResult = ilm_surfaceSetOpacity(id, opacity);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set opacity "<< opacity << " for surface with ID " << id << "\n";
+ return;
+ }
+
+ ilm_commitChanges();
}
}
COMMAND("set layer|surface <id> visibility <visibility>")
//=============================================================================
{
+ t_ilm_uint id = input->getUint("id");
+ t_ilm_bool visibility = input->getBool("visibility");
+
if (input->contains("layer"))
{
- ilm_layerSetVisibility(input->getUint("id"),
- input->getBool("visibility"));
+ ilmErrorTypes callResult = ilm_layerSetVisibility(id, visibility);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set visibility "<< visibility << " for layer with ID " << id << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
else if (input->contains("surface"))
{
- ilm_surfaceSetVisibility(input->getUint("id"),
- input->getBool("visibility"));
+ ilmErrorTypes callResult = ilm_surfaceSetVisibility(id, visibility);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set visibility "<< visibility << " for surface with ID " << id << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
}
COMMAND("set layer|surface <id> orientation <orientation>")
//=============================================================================
{
+ t_ilm_uint id = input->getUint("id");
+ ilmOrientation orientation = (ilmOrientation)input->getInt("orientation");
+
if (input->contains("layer"))
{
- ilm_layerSetOrientation(input->getUint("id"),
- (ilmOrientation)input->getInt("orientation"));
+ ilmErrorTypes callResult = ilm_layerSetOrientation(id, orientation);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set orientation "<< orientation << " for layer with ID " << id << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
else if (input->contains("surface"))
{
- ilm_surfaceSetOrientation(input->getUint("id"),
- (ilmOrientation)input->getInt("orientation"));
+ ilmErrorTypes callResult = ilm_surfaceSetOrientation(id, orientation);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set orientation "<< orientation << " for surface with ID " << id << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
unsigned int* array = NULL;
unsigned int screenid = input->getUint("id");
input->getUintArray("idarray", &array, &count);
- ilm_displaySetRenderOrder(screenid, array, count);
+
+ ilmErrorTypes callResult = ilm_displaySetRenderOrder(screenid, array, count);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set render order for screen with ID " << screenid << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
else
{
unsigned int screenid = input->getUint("id");
- ilm_displaySetRenderOrder(screenid, NULL, 0);
+
+ ilmErrorTypes callResult = ilm_displaySetRenderOrder(screenid, NULL, 0);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set render order for screen with ID " << screenid << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
}
unsigned int* array = NULL;
unsigned int layerid = input->getUint("id");
input->getUintArray("idarray", &array, &count);
- ilm_layerSetRenderOrder(layerid, array, count);
+
+ ilmErrorTypes callResult = ilm_layerSetRenderOrder(layerid, array, count);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set render order for layer with ID " << layerid << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
else
{
unsigned int layerid = input->getUint("id");
- ilm_layerSetRenderOrder(layerid, NULL, 0);
+
+ ilmErrorTypes callResult = ilm_layerSetRenderOrder(layerid, NULL, 0);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set render order for layer with ID " << layerid << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
}
{
unsigned int dimension[2];
unsigned int layerid = input->getUint("id");
- ilm_layerGetDimension(layerid, dimension);
+
+ ilmErrorTypes callResult = ilm_layerGetDimension(layerid, dimension);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get dimensions of layer with ID " << layerid << "\n";
+ return;
+ }
+
dimension[0] = input->getUint("width");
- ilm_layerSetDimension(layerid, dimension);
+
+ callResult = ilm_layerSetDimension(layerid, dimension);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set dimensions of layer with ID " << layerid << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
else if (input->contains("surface"))
{
unsigned int dimension[2];
unsigned int surfaceid = input->getUint("id");
- ilm_surfaceGetDimension(surfaceid, dimension);
+
+ ilmErrorTypes callResult = ilm_surfaceGetDimension(surfaceid, dimension);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get dimensions of surface with ID " << surfaceid << "\n";
+ return;
+ }
+
dimension[0] = input->getUint("width");
- ilm_surfaceSetDimension(surfaceid, dimension);
+
+ callResult = ilm_surfaceSetDimension(surfaceid, dimension);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set dimensions of surface with ID " << surfaceid << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
}
{
unsigned int dimension[2];
unsigned int layerid = input->getUint("id");
- ilm_layerGetDimension(layerid, dimension);
+
+ ilmErrorTypes callResult = ilm_layerGetDimension(layerid, dimension);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get dimensions of layer with ID " << layerid << "\n";
+ return;
+ }
+
dimension[1] = input->getUint("height");
- ilm_layerSetDimension(layerid, dimension);
+
+ callResult = ilm_layerSetDimension(layerid, dimension);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set dimensions of layer with ID " << layerid << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
else if (input->contains("surface"))
{
unsigned int dimension[2];
unsigned int surfaceid = input->getUint("id");
- ilm_surfaceGetDimension(surfaceid, dimension);
+
+ ilmErrorTypes callResult = ilm_surfaceGetDimension(surfaceid, dimension);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get dimensions of surface with ID " << surfaceid << "\n";
+ return;
+ }
+
dimension[1] = input->getUint("height");
- ilm_surfaceSetDimension(surfaceid, dimension);
+
+ callResult = ilm_surfaceSetDimension(surfaceid, dimension);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set dimensions of surface with ID " << surfaceid << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
}
COMMAND("set layer|surface <id> position <x> <y>")
//=============================================================================
{
+ unsigned int id = input->getUint("id");
+ unsigned int dimension[2];
+ dimension[0] = input->getUint("x");
+ dimension[1] = input->getUint("y");
+
if (input->contains("layer"))
{
- unsigned int dimension[2];
- unsigned int layerid = input->getUint("id");
- dimension[0] = input->getUint("x");
- dimension[1] = input->getUint("y");
- ilm_layerSetPosition(layerid, dimension);
+ ilmErrorTypes callResult = ilm_layerSetPosition(id, dimension);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set position of layer with ID " << id << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
else if (input->contains("surface"))
{
- unsigned int dimension[2];
- unsigned int surfaceid = input->getUint("id");
- dimension[0] = input->getUint("x");
- dimension[1] = input->getUint("y");
- ilm_surfaceSetPosition(surfaceid, dimension);
+ ilmErrorTypes callResult = ilm_surfaceSetPosition(id, dimension);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set position of surface with ID " << id << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
}
unsigned int layerid = input->getUint("layerid");
unsigned int width = input->getUint("width");
unsigned int height = input->getUint("height");
- ilm_layerCreateWithDimension(&layerid, width, height);
+
+ ilmErrorTypes callResult = ilm_layerCreateWithDimension(&layerid, width, height);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to create layer with ID " << layerid << "\n";
+ return;
+ }
}
else
{
unsigned int layerid = input->getUint("layerid");
- ilm_layerCreate(&layerid);
+
+ ilmErrorTypes callResult = ilm_layerCreate(&layerid);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to create layer with ID " << layerid << "\n";
+ return;
+ }
}
}
unsigned int width = input->getUint("width");
unsigned int height = input->getUint("height");
e_ilmPixelFormat pixelformat = (e_ilmPixelFormat)input->getUint("pixelformat");
- ilm_surfaceCreate(nativeHandle, width, height, pixelformat, &surfaceid);
+
+ ilmErrorTypes callResult = ilm_surfaceCreate(nativeHandle, width, height, pixelformat, &surfaceid);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to create surface with ID " << surfaceid << "\n";
+ return;
+ }
}
//=============================================================================
if (input->contains("layer"))
{
unsigned int layerid = input->getUint("id");
- ilm_layerRemove(layerid);
+
+ ilmErrorTypes callResult = ilm_layerRemove(layerid);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to remove layer with ID " << layerid << "\n";
+ return;
+ }
}
else if (input->contains("surface"))
{
unsigned int surfaceid = input->getUint("id");
- ilm_surfaceRemove(surfaceid);
+
+ ilmErrorTypes callResult = ilm_surfaceRemove(surfaceid);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to remove surface with ID " << surfaceid << "\n";
+ return;
+ }
}
+
+ ilm_commitChanges();
}
//=============================================================================
COMMAND("set layer|surface <id> chromakey <red> <green> <blue>")
//=============================================================================
{
+ t_ilm_layer id = input->getUint("id");
+ t_ilm_int color[3] =
+ {
+ input->getInt("red"),
+ input->getInt("green"),
+ input->getInt("blue")
+ };
+
if (input->contains("layer"))
{
- t_ilm_layer layer = input->getUint("id");
- t_ilm_int color[3] =
+ ilmErrorTypes callResult = ilm_layerSetChromaKey(id, color);
+ if (ILM_SUCCESS != callResult)
{
- input->getInt("red"),
- input->getInt("green"),
- input->getInt("blue")
- };
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set chroma key (" << color[0] << ", " << color[1] << ", " << color[2] << ") for layer with ID " << id << "\n";
+ return;
+ }
- ilm_layerSetChromaKey(layer, color);
ilm_commitChanges();
}
else if (input->contains("surface"))
{
- t_ilm_surface surface = input->getUint("id");
- t_ilm_int color[3] =
+ ilmErrorTypes callResult = ilm_surfaceSetChromaKey(id, color);
+ if (ILM_SUCCESS != callResult)
{
- input->getInt("red"),
- input->getInt("green"),
- input->getInt("blue")
- };
- ilm_surfaceSetChromaKey(surface, color);
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set chroma key (" << color[0] << ", " << color[1] << ", " << color[2] << ") for surface with ID " << id << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
}
//=============================================================================
{
t_ilm_surface surface = input->getUint("surfaceid");
- ilm_surfaceSetChromaKey(surface, NULL);
+
+ ilmErrorTypes callResult = ilm_surfaceSetChromaKey(surface, NULL);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to disable chroma key for surface with ID " << surface << "\n";
+ return;
+ }
+
ilm_commitChanges();
}
//get screen information
t_ilm_uint screenWidth = 0, screenHeight = 0;
- ilm_getScreenResolution(0, &screenWidth, &screenHeight);
+
+ ilmErrorTypes callResult = ilm_getScreenResolution(0, &screenWidth, &screenHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get screen resolution for screen with ID " << 0 << "\n";
+ return;
+ }
+
scene.screenWidth = screenWidth;
scene.screenHeight = screenHeight;
//get screens
unsigned int screenCount = 0;
t_ilm_display* screenArray = NULL;
- ilm_getScreenIDs(&screenCount, &screenArray);
+
+ callResult = ilm_getScreenIDs(&screenCount, &screenArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get available screen IDs\n";
+ return;
+ }
+
scene.screens = vector<t_ilm_display>(screenArray, screenArray + screenCount);
//layers on each screen
t_ilm_int layerCount = 0;
t_ilm_layer* layerArray = NULL;
- ilm_getLayerIDsOnScreen(screenId, &layerCount, &layerArray);
+
+ callResult = ilm_getLayerIDsOnScreen(screenId, &layerCount, &layerArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get layers on screen with ID "<< screenId <<"\n";
+ return;
+ }
scene.screenLayers[screenId] = vector<t_ilm_layer>(layerArray, layerArray + layerCount);
//layer properties
ilmLayerProperties lp;
- ilm_getPropertiesOfLayer(layerId, &lp);
+
+ callResult = ilm_getPropertiesOfLayer(layerId, &lp);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get properties of layer with ID "<< layerId <<"\n";
+ return;
+ }
+
scene.layerProperties[layerId] = lp;
}
//surfaces on layer (in rendering order)
int surfaceCount = 0;
t_ilm_surface* surfaceArray = NULL;
- ilm_getSurfaceIDsOnLayer(layerId, &surfaceCount, &surfaceArray);
+
+ callResult = ilm_getSurfaceIDsOnLayer(layerId, &surfaceCount, &surfaceArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get surfaces on layer with ID "<< layerId <<"\n";
+ return;
+ }
//rendering order on layer
scene.layerSurfaces[layerId] = vector<t_ilm_surface>(surfaceArray, surfaceArray + surfaceCount);
//get all surfaces (on layers and without layers)
t_ilm_int surfaceCount = 0;
t_ilm_surface* surfaceArray = NULL;
- ilm_getSurfaceIDs(&surfaceCount, &surfaceArray);
+
+ callResult = ilm_getSurfaceIDs(&surfaceCount, &surfaceArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get available surfaces\n";
+ return;
+ }
+
scene.surfaces = vector<t_ilm_surface>(surfaceArray, surfaceArray + surfaceCount);
for (int k = 0; k < surfaceCount; ++k)
//surface properties
ilmSurfaceProperties sp;
- ilm_getPropertiesOfSurface(surfaceId, &sp);
+
+ callResult = ilm_getPropertiesOfSurface(surfaceId, &sp);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get properties of surface with ID " << surfaceId << "\n";
+ return;
+ }
+
scene.surfaceProperties[surfaceId] = sp;
}
}
t_ilm_surface surface = it->first;
t_ilm_layer layer = it->second;
- ilm_layerRemoveSurface(layer, surface);
+ ilmErrorTypes callResult = ilm_layerRemoveSurface(layer, surface);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to remove surface " << surface << " from layer " << layer << "\n";
+ return;
+ }
}
ilm_commitChanges();
if (find(pScene->surfaces.begin(), pScene->surfaces.end(), surface) == pScene->surfaces.end())
{
//remove surface !
- ilm_surfaceRemove(surface);
+ ilmErrorTypes callResult = ilm_surfaceRemove(surface);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to remove surface " << surface << "\n";
+ return;
+ }
}
}
if (find(pScene->layers.begin(), pScene->layers.end(), layer) == pScene->layers.end())
{
//remove surface !
- ilm_layerRemove(layer);
+ ilmErrorTypes callResult = ilm_layerRemove(layer);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to remove layer " << layer << "\n";
+ return;
+ }
}
}
if (find(initialScene.layers.begin(), initialScene.layers.end(), layer) == initialScene.layers.end())
{
ilmLayerProperties& props = pScene->layerProperties[layer];
- ilm_layerCreateWithDimension(&layer, props.origSourceWidth, props.origSourceHeight);
+
+ ilmErrorTypes callResult = ilm_layerCreateWithDimension(&layer, props.origSourceWidth, props.origSourceHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to create layer with ID " << layer << " and dimensions (" << props.origSourceWidth << " ," << props.origSourceHeight << ")\n";
+ return;
+ }
}
}
for(t_ilm_uint i = 0 ; i < count ; ++i)
{
pScene->screens.push_back(screenArray[i]);
- ilm_getScreenResolution(screenArray[0], & pScene->screenWidth, & pScene->screenHeight);
+
+ ilmErrorTypes callResult = ilm_getScreenResolution(screenArray[0], & pScene->screenWidth, & pScene->screenHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get screen resolution for screen with ID " << screenArray[0] << "\n";
+ return;
+ }
}
}
extraLayer = pScene->layers[0];
}
- ilm_layerCreate(&extraLayer);
+ ilmErrorTypes callResult = ilm_layerCreate(&extraLayer);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to create layer\n";
+ }
ilmLayerProperties extraLayerProperties;
extraLayerProperties.destHeight = pScene->screenHeight;
t_ilm_surface surface = *it;
tuple4 coords = interpolateCoordinatesHelper(start[surface], end[surface], t);
- ilm_surfaceSetDestinationRectangle(surface, coords.x, coords.y, coords.z - coords.x, coords.w - coords.y);
+ ilmErrorTypes callResult = ilm_surfaceSetDestinationRectangle(surface, coords.x, coords.y, coords.z - coords.x, coords.w - coords.y);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << coords.x << "," << coords.y << ", "<< coords.z - coords.x << ", " << coords.w - coords.y
+ <<") for surface with ID " << surface << "\n";
+ return;
+ }
float opacity = t * pFinalScene->surfaceProperties[surface].opacity
+ (1-t) * pInitialScene->surfaceProperties[surface].opacity;
while (gBenchmark_running)
{
- ilm_getNumberOfHardwareLayers(0, &hwLayerCnt);
+ t_ilm_uint screenid = 0;
+
+ ilmErrorTypes callResult = ilm_getNumberOfHardwareLayers(screenid, &hwLayerCnt);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get number of hardware layers for screen with ID " << screenid << "\n";
+ return;
+ }
+
++runs;
}
void setSurfaceKeyboardFocus(t_ilm_surface surface)
{
- if (ilm_SetKeyboardFocusOn(surface) != ILM_SUCCESS)
+ ilmErrorTypes callResult = ilm_SetKeyboardFocusOn(surface);
+ if (ILM_SUCCESS != callResult)
{
- cerr << "Error during communication" << endl;
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set keyboard focus at surface with ID " << surface << "\n";
+ return;
}
}
void getKeyboardFocus()
{
t_ilm_surface surfaceId;
- if (ilm_GetKeyboardFocusSurfaceId(&surfaceId) == ILM_SUCCESS)
+
+ ilmErrorTypes callResult = ilm_GetKeyboardFocusSurfaceId(&surfaceId);
+ if (ILM_SUCCESS == callResult)
{
cout << "keyboardFocusSurfaceId == " << surfaceId << endl;
}
else
{
- cerr << "Error during communication" << endl;
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get keyboard focus surface ID\n";
+ return;
}
}
tok = strtok(NULL, ":");
}
- ilm_UpdateInputEventAcceptanceOn(surfaceId, devices, acceptance);
+ ilmErrorTypes callResult = ilm_UpdateInputEventAcceptanceOn(surfaceId, devices, acceptance);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to update input event acceptance on surface with ID " << surfaceId << "\n";
+ return;
+ }
+
ilm_commitChanges();
delete[] str;
void testNotificationLayer(t_ilm_layer layerid)
{
-
- ilmErrorTypes ret;
cout << "Setup notification for layer " << layerid << " \n";
- ret = ilm_layerAddNotification(layerid, layerNotificationCallback);
- if (ret != ILM_SUCCESS)
+ ilmErrorTypes callResult = ilm_layerAddNotification(layerid, layerNotificationCallback);
+ if (ILM_SUCCESS != callResult)
{
- cerr << "ilm_layerAddNotification returned error " << ret << "\n";
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to add notification callback to layer with ID " << layerid << "\n";
+ return;
}
for (int i = 0; i < 2; ++i)
{
unsigned int layerid = layerids[i];
cout << "Setup notification for layer " << layerid << "\n";
- ilmErrorTypes ret = ilm_layerAddNotification(layerid, layerNotificationCallback);
- if (ret != ILM_SUCCESS)
+ ilmErrorTypes callResult = ilm_layerAddNotification(layerid, layerNotificationCallback);
+ if (ILM_SUCCESS != callResult)
{
- cerr << "ilm_layerAddNotification(" << layerid << ") returned error " << ret << "\n";
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to add notification callback to layer with ID " << layerid << "\n";
return;
}
}
{
unsigned int layerid = layerids[i];
cout << "Removing notification for layer " << layerid << "\n";
- ilm_layerRemoveNotification(layerid);
+
+ ilmErrorTypes callResult = ilm_layerRemoveNotification(layerid);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to remove notification callback of layer with ID " << layerid << "\n";
+ return;
+ }
}
if (layerids)
{
unsigned int surfaceid = surfaceids[i];
cout << "Setup notification for surface " << surfaceid << "\n";
- ilmErrorTypes ret = ilm_surfaceAddNotification(surfaceid, surfaceNotificationCallback);
- if (ret != ILM_SUCCESS)
+ ilmErrorTypes callResult = ilm_surfaceAddNotification(surfaceid, surfaceNotificationCallback);
+ if (ILM_SUCCESS != callResult)
{
- cerr << "ilm_surfaceAddNotification(" << surfaceid << ") returned error " << ret << "\n";
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to add notification callback to surface with ID " << surfaceid << "\n";
return;
}
}
{
unsigned int surfaceid = surfaceids[i];
cout << "Removing notification for surface " << surfaceid << "\n";
- ilm_surfaceRemoveNotification(surfaceid);
+
+ ilmErrorTypes callResult = ilm_surfaceRemoveNotification(surfaceid);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to remove notification callback of surface with ID " << surfaceid << "\n";
+ return;
+ }
}
if (surfaceids)
void setOptimization(t_ilm_uint id, t_ilm_uint mode)
{
- if (ilm_SetOptimizationMode((ilmOptimization)id,
- (ilmOptimizationMode)mode) != ILM_SUCCESS)
+ ilmErrorTypes callResult = ilm_SetOptimizationMode((ilmOptimization)id,
+ (ilmOptimizationMode)mode);
+ if (ILM_SUCCESS != callResult)
{
- cerr << "Error during communication" << endl;
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set optimization with ID "<< id <<" mode " << mode << "\n";
+ return;
}
ilm_commitChanges();
{
ilmOptimization optimizationId = (ilmOptimization)id;
ilmOptimizationMode optimizationMode;
- if (ilm_GetOptimizationMode(optimizationId, &optimizationMode) == ILM_SUCCESS)
+
+ ilmErrorTypes callResult = ilm_GetOptimizationMode(optimizationId, &optimizationMode);
+ if (callResult == ILM_SUCCESS)
{
switch ( optimizationId )
{
}
else
{
- cerr << "Error during communication" << endl;
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get mode for optimization with ID "<< optimizationId << "\n";
+ return;
}
ilm_commitChanges();
{
//set source region to only the visible part of the surface
int ySource = static_cast<int>(-coordinates.y / surfaceScale[surface]);
- ilm_surfaceSetSourceRectangle(surface, 0, ySource, properties.sourceWidth, properties.sourceHeight - ySource);
+
+ ilmErrorTypes callResult = ilm_surfaceSetSourceRectangle(surface, 0, ySource, properties.sourceWidth, properties.sourceHeight - ySource);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set source rectangle (" << 0 << "," << ySource << ", "<< properties.sourceWidth << ", " << properties.sourceHeight - ySource
+ <<") for surface with ID " << surface << "\n";
+ }
//set the destination region AT THE TOP of the layer used for displaying the surface
- ilm_surfaceSetDestinationRectangle(surface,
+ callResult = ilm_surfaceSetDestinationRectangle(surface,
coordinates.x,
0,
max(0, coordinates.z - coordinates.x),
max(0, coordinates.w));
+
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << coordinates.x << "," << 0 << ", "<< max(0, coordinates.z - coordinates.x) << ", "
+ << max(0, coordinates.w) <<") for surface with ID " << surface << "\n";
+ }
}
else
{
//set source region to whole surface
- ilm_surfaceSetSourceRectangle(surface, 0, 0, properties.sourceWidth, properties.sourceHeight);
+ ilmErrorTypes callResult = ilm_surfaceSetSourceRectangle(surface, 0, 0, properties.sourceWidth, properties.sourceHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set source rectangle (" << 0 << "," << 0 << ", "<< properties.sourceWidth << ", " << properties.sourceHeight
+ <<") for surface with ID " << surface << "\n";
+ }
//set destination region to the region on the layer used for displaying the surface
- ilm_surfaceSetDestinationRectangle(surface,
+ callResult = ilm_surfaceSetDestinationRectangle(surface,
coordinates.x,
coordinates.y,
max(0, coordinates.z - coordinates.x),
max(0, coordinates.w - coordinates.y));
+
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << coordinates.x << "," << coordinates.y << ", "<< max(0, coordinates.z - coordinates.x) << ", "
+ << max(0, coordinates.w - coordinates.y) <<") for surface with ID " << surface << "\n";
+ }
}
surfaceCoordinates[surface] = coordinates;
t_ilm_surface surface = *it;
float opacity = min(1.0, 1.1 - surfaceScale[surface]);
- ilm_surfaceSetOpacity(surface, opacity);
+
+ ilmErrorTypes callResult = ilm_surfaceSetOpacity(surface, opacity);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set opacity " << opacity <<" for surface with ID " << surface << "\n";
+ }
}
for (vector<t_ilm_surface>::iterator it = renderedSurfaces.begin();
{
//set source region to only the visible part of the surface
int ySource = static_cast<int>(-coordinates.y / surfaceScale[surface]);
- ilm_surfaceSetSourceRectangle(surface, 0, ySource, properties.sourceWidth, properties.sourceHeight - ySource);
+
+ ilmErrorTypes callResult = ilm_surfaceSetSourceRectangle(surface, 0, ySource, properties.sourceWidth, properties.sourceHeight - ySource);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set source rectangle (" << 0 << "," << ySource << ", "<< properties.sourceWidth << ", " << properties.sourceHeight - ySource
+ <<") for surface with ID " << surface << "\n";
+ }
//set the destination region AT THE TOP of the layer used for displaying the surface
- ilm_surfaceSetDestinationRectangle(surface,
+ callResult = ilm_surfaceSetDestinationRectangle(surface,
coordinates.x,
0,
max(0, coordinates.z - coordinates.x),
max(0, coordinates.w));
+
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << coordinates.x << "," << 0 << ", "<< max(0, coordinates.z - coordinates.x) << ", " << max(0, coordinates.w)
+ <<") for surface with ID " << surface << "\n";
+ }
}
else
{
//set source region to whole surface
- ilm_surfaceSetSourceRectangle(surface, 0, 0, properties.sourceWidth, properties.sourceHeight);
+ ilmErrorTypes callResult = ilm_surfaceSetSourceRectangle(surface, 0, 0, properties.sourceWidth, properties.sourceHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set source rectangle (" << 0 << "," << 0 << ", "<< properties.sourceWidth << ", " << properties.sourceHeight
+ <<") for surface with ID " << surface << "\n";
+ }
//set destination region to the region on the layer used for displaying the surface
- ilm_surfaceSetDestinationRectangle(surface,
+ callResult = ilm_surfaceSetDestinationRectangle(surface,
coordinates.x,
coordinates.y,
max(0, coordinates.z - coordinates.x),
max(0, coordinates.w - coordinates.y));
+
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << coordinates.x << "," << coordinates.y << ", "<< max(0, coordinates.z - coordinates.x) << ", "
+ << max(0, coordinates.w - coordinates.y) <<") for surface with ID " << surface << "\n";
+ }
}
surfaceCoordinates[surface] = coordinates;
int displacement = static_cast<int>(t * abs(surfaceSpeed[surface]));
t_ilm_float opacity = min(1.0, max(0.0, 1 - fraction)); //between 0 and 1
- ilm_surfaceSetOpacity(surface, opacity);
+
+ ilmErrorTypes callResult = ilm_surfaceSetOpacity(surface, opacity);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set opacity " << opacity <<" for surface with ID " << surface << "\n";
+ }
//move
coordinates.y += displacement;
{
//set source region to only the visible part of the surface
int ySource = static_cast<int>(-coordinates.y / surfaceScale[surface]);
- ilm_surfaceSetSourceRectangle(surface,
+ ilmErrorTypes callResult = ilm_surfaceSetSourceRectangle(surface,
0,
ySource,
properties.sourceWidth,
properties.sourceHeight - ySource);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set source rectangle (" << 0 << "," << ySource << ", "<< properties.sourceWidth << ", " << properties.sourceHeight - ySource
+ <<") for surface with ID " << surface << "\n";
+ }
+
//set the destination region AT THE TOP of the layer used for displaying the surface
- ilm_surfaceSetDestinationRectangle(surface,
+ callResult = ilm_surfaceSetDestinationRectangle(surface,
coordinates.x,
0,
max(0, coordinates.z - coordinates.x),
max(0, coordinates.w));
+
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << coordinates.x << "," << 0 << ", "<< max(0, coordinates.z - coordinates.x) << ", " << max(0, coordinates.w)
+ <<") for surface with ID " << surface << "\n";
+ }
}
else
{
//set source region to whole surface
- ilm_surfaceSetSourceRectangle(surface, 0, 0, properties.sourceWidth, properties.sourceHeight);
+ ilmErrorTypes callResult = ilm_surfaceSetSourceRectangle(surface, 0, 0, properties.sourceWidth, properties.sourceHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set source rectangle (" << 0 << "," << 0 << ", "<< properties.sourceWidth << ", " << properties.sourceHeight
+ <<") for surface with ID " << surface << "\n";
+ }
//set destination region to the region on the layer used for displaying the surface
- ilm_surfaceSetDestinationRectangle(surface,
+ callResult = ilm_surfaceSetDestinationRectangle(surface,
coordinates.x,
coordinates.y,
max(0, coordinates.z - coordinates.x),
max(0, coordinates.w - coordinates.y));
+
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << coordinates.x << "," << coordinates.y << ", "<< max(0, coordinates.z - coordinates.x) << ", "
+ << max(0, coordinates.w - coordinates.y) <<") for surface with ID " << surface << "\n";
+ }
}
surfaceCoordinates[surface] = coordinates;
surfaceProperties.destHeight = 0;
surfaceProperties.destWidth = 0;
- ilm_surfaceSetDestinationRectangle(surface,
+ ilmErrorTypes callResult = ilm_surfaceSetDestinationRectangle(surface,
surfaceProperties.destX,
surfaceProperties.destY,
surfaceProperties.destWidth,
surfaceProperties.destHeight);
+
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << surfaceProperties.destX << "," << surfaceProperties.destY << ", "<< surfaceProperties.destWidth << ", "
+ << surfaceProperties.destHeight <<") for surface with ID " << surface << "\n";
+ }
+
}
//sleeping time
currentSurfaceIndex = (currentSurfaceIndex + 1) % renderedSurfaces.size();
t_ilm_layer layer = pDemoScene->screenLayers.begin()->second[0];
- ilm_surfaceSetDestinationRectangle(surface,
+ ilmErrorTypes callResult = ilm_surfaceSetDestinationRectangle(surface,
surfaceProperties.destX,
surfaceProperties.destY,
surfaceProperties.destWidth,
surfaceProperties.destHeight);
- ilm_layerSetRenderOrder(layer, renderedSurfaces.data() + currentSurfaceIndex, 1);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << surfaceProperties.destX << "," << surfaceProperties.destY << ", "<< surfaceProperties.destWidth << ", "
+ << surfaceProperties.destHeight <<") for surface with ID " << surface << "\n";
+ }
+
+ callResult = ilm_layerSetRenderOrder(layer, renderedSurfaces.data() + currentSurfaceIndex, 1);
+
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set render order for layer with ID " << layer << "\n";
+ }
}
else
{
surfaceProperties.destWidth += 2 * change;
surfaceProperties.destHeight += 2 * change;
- ilm_surfaceSetDestinationRectangle(surface,
+ ilmErrorTypes callResult = ilm_surfaceSetDestinationRectangle(surface,
surfaceProperties.destX,
surfaceProperties.destY,
surfaceProperties.destWidth,
surfaceProperties.destHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << surfaceProperties.destX << "," << surfaceProperties.destY << ", "<< surfaceProperties.destWidth << ", "
+ << surfaceProperties.destHeight <<") for surface with ID " << surface << "\n";
+ }
+
float opacity = 1 / pow(t, 0.4);
- ilm_surfaceSetOpacity(surface, opacity);
+
+ callResult = ilm_surfaceSetOpacity(surface, opacity);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set opacity " << opacity <<" for surface with ID " << surface << "\n";
+ }
}
ilm_commitChanges();
surfaceProperties.destHeight = 0;
surfaceProperties.destWidth = 0;
- ilm_surfaceSetDestinationRectangle(surface,
+ ilmErrorTypes callResult = ilm_surfaceSetDestinationRectangle(surface,
surfaceProperties.destX,
surfaceProperties.destY,
surfaceProperties.destWidth,
surfaceProperties.destHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << surfaceProperties.destX << "," << surfaceProperties.destY << ", "<< surfaceProperties.destWidth << ", "
+ << surfaceProperties.destHeight <<") for surface with ID " << surface << "\n";
+ }
+
scaleFactors[surface] = 1;
}
t_ilm_layer layer = pDemoScene->screenLayers.begin()->second[0];
- ilm_surfaceSetDestinationRectangle(surface,
+ ilmErrorTypes callResult = ilm_surfaceSetDestinationRectangle(surface,
surfaceProperties.destX,
surfaceProperties.destY,
surfaceProperties.destWidth,
surfaceProperties.destHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << surfaceProperties.destX << "," << surfaceProperties.destY << ", "<< surfaceProperties.destWidth << ", "
+ << surfaceProperties.destHeight <<") for surface with ID " << surface << "\n";
+ }
+
ilm_commitChanges();
//update render order
t_ilm_surface firstSurface = renderedSurfaces[0];
renderedSurfaces[renderedSurfaces.size() - 1] = firstSurface;
- ilm_layerSetRenderOrder(layer, renderedSurfaces.data(), renderedSurfaces.size());
+ callResult = ilm_layerSetRenderOrder(layer, renderedSurfaces.data(), renderedSurfaces.size());
+
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set render order for layer with ID " << layer << "\n";
+ }
+
ilm_commitChanges();
}
else
surfaceProperties.destWidth += 2 * change;
surfaceProperties.destHeight += 2 * change;
- ilm_surfaceSetDestinationRectangle(surface,
+ ilmErrorTypes callResult = ilm_surfaceSetDestinationRectangle(surface,
surfaceProperties.destX,
surfaceProperties.destY,
surfaceProperties.destWidth,
surfaceProperties.destHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle (" << surfaceProperties.destX << "," << surfaceProperties.destY << ", "<< surfaceProperties.destWidth << ", "
+ << surfaceProperties.destHeight <<") for surface with ID " << surface << "\n";
+ }
+
float opacity = 1 / pow(scaleFactors[surface], 0.4f);
- ilm_surfaceSetOpacity(surface, opacity);
+
+ callResult = ilm_surfaceSetOpacity(surface, opacity);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set opacity " << opacity <<" for surface with ID " << surface << "\n";
+ }
}
}
cout << prefix << "---------------------------------------\n";
ilmScreenProperties screenProperties;
- ilmErrorTypes result = ilm_getPropertiesOfScreen(screenid, &screenProperties);
- if (ILM_SUCCESS != result)
+
+ ilmErrorTypes callResult = ilm_getPropertiesOfScreen(screenid, &screenProperties);
+ if (ILM_SUCCESS != callResult)
{
- cout << "LayerManagerService returned: " << ILM_ERROR_STRING(result) << "\n";
- cout << "No screen with ID " << screenid << " found\n";
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get properties of screen with ID " << screenid << " found\n";
return;
}
cout << prefix << "---------------------------------------\n";
ilmLayerProperties p;
- ilmErrorTypes result = ilm_getPropertiesOfLayer(layerid, &p);
- if (ILM_SUCCESS != result)
+
+ ilmErrorTypes callResult = ilm_getPropertiesOfLayer(layerid, &p);
+ if (ILM_SUCCESS != callResult)
{
- cout << "LayerManagerService returned: " << ILM_ERROR_STRING(result) << "\n";
- cout << "No layer with ID " << layerid << " found\n";
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get properties of layer with ID " << layerid << " found\n";
return;
}
<< "(r=" << p.chromaKeyRed << ", g=" << p.chromaKeyGreen << ", b=" << p.chromaKeyBlue << ")\n";
cout << prefix << "- surface render order: ";
+
int surfaceCount = 0;
unsigned int* surfaceArray = NULL;
- ilm_getSurfaceIDsOnLayer(layerid, &surfaceCount, &surfaceArray);
+
+ callResult = ilm_getSurfaceIDsOnLayer(layerid, &surfaceCount, &surfaceArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get surfaces on layer with ID " << layerid << " \n";
+ return;
+ }
+
for (int surfaceIndex = 0; surfaceIndex < surfaceCount; ++surfaceIndex)
{
cout << surfaceArray[surfaceIndex] << "(0x" << hex
cout << "\n";
cout << prefix << "- on screen: ";
+
unsigned int screenCount = 0;
unsigned int* screenArray = NULL;
- ilm_getScreenIDs(&screenCount, &screenArray);
+
+ callResult = ilm_getScreenIDs(&screenCount, &screenArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get available screens\n";
+ return;
+ }
+
for (unsigned int screenIndex = 0; screenIndex < screenCount;
++screenIndex)
{
unsigned int screenid = screenArray[screenIndex];
int layerCount = 0;
unsigned int* layerArray = NULL;
- ilm_getLayerIDsOnScreen(screenid, &layerCount, &layerArray);
+
+ callResult = ilm_getLayerIDsOnScreen(screenid, &layerCount, &layerArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get available layers on screen with ID" << screenid << "\n";
+ return;
+ }
+
for (int layerIndex = 0; layerIndex < layerCount; ++layerIndex)
{
unsigned int id = layerArray[layerIndex];
cout << prefix << "---------------------------------------\n";
ilmSurfaceProperties p;
- ilmErrorTypes result = ilm_getPropertiesOfSurface(surfaceid, &p);
- if (ILM_SUCCESS != result)
+
+ ilmErrorTypes callResult = ilm_getPropertiesOfSurface(surfaceid, &p);
+ if (ILM_SUCCESS != callResult)
{
- cout << "LayerManagerService returned: " << ILM_ERROR_STRING(result) << "\n";
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
cout << "No surface with ID " << surfaceid << " found\n";
return;
}
<< "\n";
t_ilm_surface keyboardFocusSurfaceId;
- ilm_GetKeyboardFocusSurfaceId(&keyboardFocusSurfaceId);
+ callResult = ilm_GetKeyboardFocusSurfaceId(&keyboardFocusSurfaceId);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get keyboard focus surface ID\n";
+ return;
+ }
cout << prefix << "- has keyboard focus: "
<< (keyboardFocusSurfaceId == surfaceid ? "true" : "false")
cout << prefix << "- on layer: ";
int layerCount = 0;
unsigned int* layerArray = NULL;
- ilm_getLayerIDs(&layerCount, &layerArray);
+
+ callResult = ilm_getLayerIDs(&layerCount, &layerArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get available layer IDs\n";
+ return;
+ }
+
for (int layerIndex = 0; layerIndex < layerCount; ++layerIndex)
{
unsigned int layerid = layerArray[layerIndex];
int surfaceCount = 0;
unsigned int* surfaceArray = NULL;
- ilm_getSurfaceIDsOnLayer(layerid, &surfaceCount, &surfaceArray);
+
+ callResult = ilm_getSurfaceIDsOnLayer(layerid, &surfaceCount, &surfaceArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get surface IDs on layer" << layerid << "\n";
+ return;
+ }
+
for (int surfaceIndex = 0; surfaceIndex < surfaceCount;
++surfaceIndex)
{
unsigned int screenCount = 0;
unsigned int* screenArray = NULL;
- ilm_getScreenIDs(&screenCount, &screenArray);
+ ilmErrorTypes callResult = ilm_getScreenIDs(&screenCount, &screenArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get available screen IDs\n";
+ return;
+ }
for (unsigned int screenIndex = 0; screenIndex < screenCount; ++screenIndex)
{
int layerCount = 0;
unsigned int* layerArray = NULL;
- ilm_getLayerIDsOnScreen(screenid, &layerCount, &layerArray);
+
+ callResult = ilm_getLayerIDsOnScreen(screenid, &layerCount, &layerArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get available layers on screen with ID" << screenid << "\n";
+ return;
+ }
+
for (int layerIndex = 0; layerIndex < layerCount; ++layerIndex)
{
unsigned int layerid = layerArray[layerIndex];
int surfaceCount = 0;
unsigned int* surfaceArray = NULL;
- ilm_getSurfaceIDsOnLayer(layerid, &surfaceCount, &surfaceArray);
+
+ callResult = ilm_getSurfaceIDsOnLayer(layerid, &surfaceCount, &surfaceArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get available surfaces on layer with ID" << layerid << "\n";
+ return;
+ }
+
for (int surfaceIndex = 0; surfaceIndex < surfaceCount; ++surfaceIndex)
{
unsigned int surfaceid = surfaceArray[surfaceIndex];
using std::max;
using std::min;
+#include <cstdlib>
#include <iostream>
using std::cout;
{
t_ilm_surface currentSurface = *surface;
- ilm_surfaceSetVisibility(currentSurface, false);
+ ilmErrorTypes callResult = ilm_surfaceSetVisibility(currentSurface, false);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set visibility "<< false << " for surface with ID " << currentSurface << "\n";
+ }
+
ilm_commitChanges();
usleep(100000);
- ilm_surfaceSetVisibility(currentSurface, true);
+ callResult = ilm_surfaceSetVisibility(currentSurface, true);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set visibility "<< true << " for surface with ID " << currentSurface << "\n";
+ }
+
ilm_commitChanges();
}
//if surface does not exist: create it
t_ilm_int surfaceCount;
t_ilm_surface* surfaceArray;
- ilm_getSurfaceIDs(&surfaceCount, &surfaceArray);
+
+ ilmErrorTypes callResult = ilm_getSurfaceIDs(&surfaceCount, &surfaceArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get available surface IDs\n";
+ }
+
if (find(surfaceArray, surfaceArray + surfaceCount, surfaceId)
== surfaceArray + surfaceCount)
{
ilmPixelFormat pixelFormat;
pixelFormat = toPixelFormat(props.pixelformat);
- ilm_surfaceCreate(props.nativeSurface, props.origSourceWidth, props.origSourceHeight, pixelFormat, &surfaceId);
+
+ ilmErrorTypes callResult = ilm_surfaceCreate(props.nativeSurface, props.origSourceWidth, props.origSourceHeight, pixelFormat, &surfaceId);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to create surface\n";
+ }
}
}
//create layer if does not exist
t_ilm_int layerCount;
t_ilm_layer* layerArray;
- ilm_getLayerIDs(&layerCount, &layerArray);
+
+ ilmErrorTypes callResult = ilm_getLayerIDs(&layerCount, &layerArray);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to get available layer IDs\n";
+ }
if (find(layerArray, layerArray + layerCount, layerId) == layerArray + layerCount)
{
- ilm_layerCreateWithDimension(&layerId, props.origSourceWidth, props.origSourceHeight);
+ ilmErrorTypes callResult = ilm_layerCreateWithDimension(&layerId, props.origSourceWidth, props.origSourceHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to create layer width dimensions (" << props.origSourceWidth <<" ,"<< props.origSourceHeight << ")\n";
+ }
+
ilm_commitChanges();
}
createSceneContentsHelper(*it);
}
- ilm_layerSetRenderOrder(layerId, renderOrder.data(), renderOrder.size());
+ callResult = ilm_layerSetRenderOrder(layerId, renderOrder.data(), renderOrder.size());
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set render order for layer with ID "<< layerId << ")\n";
+ }
+
ilm_commitChanges();
}
ilm_commitChanges();
}
- ilm_displaySetRenderOrder(displayId, renderOrder.data(), renderOrder.size());
+ ilmErrorTypes callResult = ilm_displaySetRenderOrder(displayId, renderOrder.data(), renderOrder.size());
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set render order for display with ID "<< displayId << ")\n";
+ }
+
ilm_commitChanges();
}
ilmPixelFormat pixelFormat;
pixelFormat = toPixelFormat(props.pixelformat);
- ilm_surfaceSetNativeContent(props.nativeSurface, props.origSourceWidth, props.origSourceHeight, pixelFormat, surfaceId);
+
+ ilmErrorTypes callResult = ilm_surfaceSetNativeContent(props.nativeSurface, props.origSourceWidth, props.origSourceHeight, pixelFormat, surfaceId);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set native content for surface with ID "<< surfaceId << ")\n";
+ }
ilm_commitChanges();
ilmLayerProperties props = getLayerProperties(pIlmlayer);
//set layer properties
- ilm_layerSetDestinationRectangle(layerId, props.destX, props.destY, props.destWidth, props.destHeight);
+ ilmErrorTypes callResult = ilm_layerSetDestinationRectangle(layerId, props.destX, props.destY, props.destWidth, props.destHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to set destination rectangle for layer with ID "<< layerId << ")\n";
+ }
+
ilm_commitChanges();
ilm_layerSetOpacity(layerId, props.opacity);
ilm_commitChanges();
for (map<t_ilm_surface, t_ilm_layer>::iterator it = currentScene.surfaceLayer.begin();
it != currentScene.surfaceLayer.end(); ++it)
{
- ilm_layerRemoveSurface(it->second, it->first);
+ ilmErrorTypes callResult = ilm_layerRemoveSurface(it->second, it->first);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to remove surface "<< it->first << " from layer " << it->second << ")\n";
+ }
}
ilm_commitChanges();