Exemplo n.º 1
0
VideoVisual::~VideoVisual()
{
    mutex()->lock();
    if (m_audio)
        m_audio->removeVisual(this);
    DeleteNodes();
    mutex()->unlock();
}
Exemplo n.º 2
0
// caller holds lock
void VideoVisual::add(const void *b, unsigned long b_len, unsigned long w, int c,
                      int p)
{
    if (!m_disabled && m_nodes.size() > 500)
    {
        LOG(VB_GENERAL, LOG_ERR, DESC +
            QString("Over 500 nodes buffered - disabling visualiser."));
        DeleteNodes();
        m_disabled = true;
    }

    if (m_disabled)
        return;

    long len = b_len, cnt;
    short *l = nullptr, *r = nullptr;

    len /= c;
    len /= (p / 8);

    if (len > 512)
        len = 512;

    cnt = len;

    if (c == 2)
    {
        l = new short[len];
        r = new short[len];

        if (p == 8)
            stereo16_from_stereopcm8(l, r, (uchar *) b, cnt);
        else if (p == 16)
            stereo16_from_stereopcm16(l, r, (short *) b, cnt);
        else if (p == 32)
            stereo16_from_stereofloat32(l, r, reinterpret_cast<const float * >(b), cnt);
        else
            len = 0;
    }
    else if (c == 1)
    {
        l = new short[len];

        if (p == 8)
            mono16_from_monopcm8(l, (uchar *) b, cnt);
        else if (p == 16)
            mono16_from_monopcm16(l, (short *) b, cnt);
        else if (p == 32)
            mono16_from_monofloat32(l, reinterpret_cast<const float * >(b), cnt);
        else
            len = 0;
    }
    else
        len = 0;

    m_nodes.append(new VisualNode(l, r, len, w));
}
Exemplo n.º 3
0
void rOctree<T>::DeleteNodes(node_type* node) {
    for (size_t i =0; i < node->m_children.size(); i++) {

        if (node->m_children[i] )
            DeleteNodes(node->m_children[i]);

    }

    delete node;
}
Exemplo n.º 4
0
void rOctree<T>::Uninit() {
    m_items.clear();

    if (m_root)
        DeleteNodes(m_root);

    m_root = NULL;

    m_numNodes = 0;
}
Exemplo n.º 5
0
void HierarchyTreeController::DeleteNode(const HierarchyTreeNode::HIERARCHYTREENODEID nodeID,
										 bool deleteNodeFromMemory, bool deleteNodeFromScene,
										 bool deleteNodeFromDisk)
{
	HierarchyTreeNode::HIERARCHYTREENODESLIST nodes;
	
	HierarchyTreeNode* nodeToDelete = GetTree().GetNode(nodeID);
	if (!nodeToDelete)
	{
		return;
	}

	nodes.push_back(nodeToDelete);
	DeleteNodes(nodes, deleteNodeFromMemory, deleteNodeFromScene, deleteNodeFromDisk);
}
Exemplo n.º 6
0
// caller holds lock
void VideoVisual::add(uchar *b, unsigned long b_len, unsigned long w, int c, int p)
{
    if (!m_disabled && m_nodes.size() > 500)
    {
        VERBOSE(VB_GENERAL, DESC +
            QString("Over 500 nodes buffered - disabling visualiser."));
        DeleteNodes();
        m_disabled = true;
    }

    if (m_disabled)
        return;

    long len = b_len, cnt;
    short *l = 0, *r = 0;

    len /= c;
    len /= (p / 8);

    if (len > 512)
        len = 512;

    cnt = len;

    if (c == 2)
    {
        l = new short[len];
        r = new short[len];

        if (p == 8)
            stereo16_from_stereopcm8(l, r, b, cnt);
        else if (p == 16)
            stereo16_from_stereopcm16(l, r, (short *) b, cnt);
    }
    else if (c == 1)
    {
        l = new short[len];

        if (p == 8)
            mono16_from_monopcm8(l, b, cnt);
        else if (p == 16)
            mono16_from_monopcm16(l, (short *) b, cnt);
    }
    else
        len = 0;

    m_nodes.append(new VisualNode(l, r, len, w));
}
Exemplo n.º 7
0
  void fibonacci_heap::DeleteNodes(Node *x) {

    if (x == nullptr)
      return;

    Node *next = x;

    do {
      Node* cur = next;
      next = next->right;
      if (cur->degree > 0)
	DeleteNodes(cur->child);   
      delete cur;
    } while (next != x);

  }
Exemplo n.º 8
0
// caller holds lock
void VideoVisual::prepare()
{
    DeleteNodes();
}
Exemplo n.º 9
0
 fibonacci_heap::~fibonacci_heap()
 {
   DeleteNodes(min);
 }
//definition section for ~Polynomial
Polynomial::~Polynomial()
{